Return the secgroup for all present states

This commit is contained in:
Monty Taylor 2015-06-17 08:02:34 -04:00
parent ef22008cac
commit 1a11f07d29

View file

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