Merge pull request #3345 from mpappas86/bugfix/ec2groupCheckMode

Prevent ec2group from deleting sgs during check_mode runs
This commit is contained in:
Matt Davis 2016-06-03 08:54:09 -07:00
commit c1f802137b

View file

@ -285,7 +285,8 @@ def main():
if group: if group:
'''found a match, delete it''' '''found a match, delete it'''
try: try:
group.delete() if not module.check_mode:
group.delete()
except Exception as e: except Exception as e:
module.fail_json(msg="Unable to delete security group '%s' - %s" % (group, e)) module.fail_json(msg="Unable to delete security group '%s' - %s" % (group, e))
else: else: