Return secgroup, not just id

This commit is contained in:
Monty Taylor 2015-06-17 04:20:42 -04:00 committed by Matt Clay
parent cc214afed6
commit 89f95471f8

View file

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