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

reviewable/pr18780/r1
Brian Coca 10 years ago
parent 3a02f31e34
commit af31cb8faf

@ -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'):

Loading…
Cancel
Save