mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Don't call sys.exit in sns_topic, use HAS_BOTO to fail
This commit is contained in:
@@ -134,9 +134,9 @@ import re
|
||||
try:
|
||||
import boto
|
||||
import boto.sns
|
||||
HAS_BOTO = True
|
||||
except ImportError:
|
||||
print "failed=True msg='boto required for this module'"
|
||||
sys.exit(1)
|
||||
HAS_BOTO = False
|
||||
|
||||
|
||||
def canonicalize_endpoint(protocol, endpoint):
|
||||
@@ -186,6 +186,9 @@ def main():
|
||||
|
||||
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
|
||||
|
||||
if not HAS_BOTO:
|
||||
module.fail_json(msg='boto required for this module')
|
||||
|
||||
name = module.params.get('name')
|
||||
state = module.params.get('state')
|
||||
display_name = module.params.get('display_name')
|
||||
|
||||
Reference in New Issue
Block a user