From 8958deeb0266ae2ead5adeddc7c3f869358ad2e5 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 1 Apr 2015 10:09:09 -0400 Subject: [PATCH] Don't update image properties if we're deleting --- lib/ansible/modules/cloud/openstack/os_image.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/os_image.py b/lib/ansible/modules/cloud/openstack/os_image.py index bdb8755e84c..7842137f7d9 100644 --- a/lib/ansible/modules/cloud/openstack/os_image.py +++ b/lib/ansible/modules/cloud/openstack/os_image.py @@ -169,13 +169,13 @@ def main(): module.exit_json(changed=changed, result=result) image = cloud.get_image(name_or_id=result['id']) - cloud.update_image_properties( - image=image, - kernel=module.params['kernel'], - ramdisk=module.params['ramdisk'], - **module.params['properties']) + cloud.update_image_properties( + image=image, + kernel=module.params['kernel'], + ramdisk=module.params['ramdisk'], + **module.params['properties']) - if module.params['state'] == 'absent': + elif module.params['state'] == 'absent': if not image: module.exit_json(changed=False, result="success") else: