From 76a1ff1788709b9f751da1951a6c2974e1cb0abf Mon Sep 17 00:00:00 2001 From: Dmitriy Smirnov Date: Wed, 29 May 2024 13:18:12 +0300 Subject: [PATCH] Fix image renaming logic in decort_osimage.__init__ method --- library/decort_osimage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/decort_osimage.py b/library/decort_osimage.py index b78c89e..0b95c39 100644 --- a/library/decort_osimage.py +++ b/library/decort_osimage.py @@ -314,8 +314,9 @@ class decort_osimage(DecortController): if amodule.params['image_id'] != 0 and amodule.params['image_name']: - self.validated_image_id = amodule.params['image_id'] - if amodule.params['image_name']: + self.validated_image_id, image_facts = self.decort_image_find(amodule) + if (self.validated_image_id and + amodule.params['image_name'] != image_facts['name']): decort_osimage.decort_image_rename(self,amodule) self.result['msg'] = ("Image renamed successfully")