diff options
author | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-03-26 12:12:09 -0700 |
---|---|---|
committer | Toshio Kuratomi <toshio@fedoraproject.org> | 2015-03-26 12:12:39 -0700 |
commit | 7e7eafb3e31ad03b255c633460766e8c93616e65 (patch) | |
tree | b5798dbecd193ebf7b4c3c93b64b8675f1381beb | |
parent | 5d776936cc67b2f43d6be9630872595243213fb0 (diff) | |
download | ansible-modules-core-7e7eafb3e31ad03b255c633460766e8c93616e65.tar.gz |
Make lack of boto call fail_json instead of sys.exit
Fixes #994
-rw-r--r-- | cloud/amazon/cloudformation.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py index b382e3f0..1da173e0 100644 --- a/cloud/amazon/cloudformation.py +++ b/cloud/amazon/cloudformation.py @@ -125,9 +125,9 @@ import time try: import boto import boto.cloudformation.connection + HAS_BOTO = True except ImportError: - print "failed=True msg='boto required for this module'" - sys.exit(1) + HAS_BOTO = False def boto_exception(err): @@ -206,6 +206,8 @@ def main(): module = AnsibleModule( argument_spec=argument_spec, ) + if not HAS_BOTO: + module.fail_json(msg='boto required for this module') state = module.params['state'] stack_name = module.params['stack_name'] |