1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make lack of boto call fail_json instead of sys.exit

Fixes #994
This commit is contained in:
Toshio Kuratomi 2015-03-26 12:12:09 -07:00 committed by Matt Clay
parent c1571928e5
commit e710e46ff2

View file

@ -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):
@ -219,6 +219,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']