Return the secgroup for all present states

pull/18777/head
Monty Taylor 10 years ago committed by Matt Clay
parent b955b2f5c8
commit 4125b576e9

@ -116,18 +116,17 @@ def main():
module.exit_json(changed=_system_state_change(module, secgroup)) module.exit_json(changed=_system_state_change(module, secgroup))
if state == 'present': if state == 'present':
changed = False
if not secgroup: if not secgroup:
secgroup = cloud.create_security_group(name, description) secgroup = cloud.create_security_group(name, description)
module.exit_json( changed = True
changed=True, id=secgroup.id, secgroup=secgroup)
else: else:
if _needs_update(module, secgroup): if _needs_update(module, secgroup):
secgroup = cloud.update_security_group( secgroup = cloud.update_security_group(
secgroup['id'], description=description) secgroup['id'], description=description)
module.exit_json( changed = True
changed=True, id=secgroup.id, secgroup=secgroup) module.exit_json(
else: changed=True, id=secgroup.id, secgroup=secgroup)
module.exit_json(changed=False)
if state == 'absent': if state == 'absent':
if not secgroup: if not secgroup:

Loading…
Cancel
Save