Merge pull request #827 from bcoca/ec2_ami_handle_exceptions
now captures connection exceptions and returns in 'nicer' module failure
This commit is contained in:
commit
ec755796c0
1 changed files with 4 additions and 1 deletions
|
@ -242,7 +242,10 @@ def main():
|
||||||
)
|
)
|
||||||
module = AnsibleModule(argument_spec=argument_spec)
|
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 module.params.get('state') == 'absent':
|
||||||
if not module.params.get('image_id'):
|
if not module.params.get('image_id'):
|
||||||
|
|
Loading…
Reference in a new issue