From 72d9da02349d223dbe70747f618e345ccf38a340 Mon Sep 17 00:00:00 2001 From: msbolshakov Date: Tue, 11 Oct 2022 21:11:38 +0700 Subject: [PATCH] add account id in osimage facts --- library/decort_osimage.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/library/decort_osimage.py b/library/decort_osimage.py index 4c39c9a..b78c89e 100644 --- a/library/decort_osimage.py +++ b/library/decort_osimage.py @@ -522,10 +522,11 @@ def main(): decon.validated_image_id = decort_osimage.decort_osimage_package_facts(image_facts)['id'] - elif amodule.params['state'] == "absent" and amodule.params['image_name'] or \ - amodule.params['image_id'] and decort_osimage.decort_osimage_package_facts(image_facts)['accountId'] == amodule.params['account_Id']: - amodule.image_id_delete = decon.validated_image_id - decort_osimage.decort_image_delete(decon,amodule) + elif amodule.params['state'] == "absent": + if amodule.params['image_name'] or amodule.params['image_id'] and\ + decort_osimage.decort_osimage_package_facts(image_facts)['accountId'] == amodule.params['account_Id']: + amodule.image_id_delete = decon.validated_image_id + decort_osimage.decort_image_delete(decon,amodule)