mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 23:31:25 -07:00
Don't call sys.exit in sns_topic, use HAS_BOTO to fail
This commit is contained in:
parent
27be34ef9d
commit
402a996430
2 changed files with 6 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue