1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Actually use changed variable

This commit is contained in:
Monty Taylor 2015-06-17 08:47:14 -04:00 committed by Matt Clay
parent 4125b576e9
commit 8ff71a3fa8

View file

@ -115,8 +115,8 @@ def main():
if module.check_mode:
module.exit_json(changed=_system_state_change(module, secgroup))
changed = False
if state == 'present':
changed = False
if not secgroup:
secgroup = cloud.create_security_group(name, description)
changed = True
@ -126,14 +126,13 @@ def main():
secgroup['id'], description=description)
changed = True
module.exit_json(
changed=True, id=secgroup.id, secgroup=secgroup)
changed=changed, id=secgroup.id, secgroup=secgroup)
if state == 'absent':
if not secgroup:
module.exit_json(changed=False)
else:
if secgroup:
cloud.delete_security_group(secgroup['id'])
module.exit_json(changed=True)
changed=True
module.exit_json(changed=changed)
except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message)