now captures connection exceptions and returns in 'nicer' module failure

This commit is contained in:
Brian Coca 2015-02-20 09:28:11 -05:00 committed by Matt Clay
parent 6e08dea567
commit 49c10e4359

View file

@ -242,7 +242,10 @@ def main():
)
module = AnsibleModule(argument_spec=argument_spec)
ec2 = ec2_connect(module)
try:
ec2 = ec2_connect(module)
except Exception, e:
module.json_fail(msg="Error while connecting to aws: %s" % str(e))
if module.params.get('state') == 'absent':
if not module.params.get('image_id'):