From 6b6aeefa7b1eadef0d69291c1354d98ca5d46dbe Mon Sep 17 00:00:00 2001 From: "Michael J. Schultz" Date: Wed, 30 Sep 2015 15:50:44 -0500 Subject: [PATCH] sns: remove BabyJSON --- lib/ansible/modules/extras/notification/sns.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/notification/sns.py b/lib/ansible/modules/extras/notification/sns.py index 70030d66196..5fd81e2047f 100644 --- a/lib/ansible/modules/extras/notification/sns.py +++ b/lib/ansible/modules/extras/notification/sns.py @@ -107,9 +107,9 @@ try: import boto import boto.ec2 import boto.sns + HAS_BOTO = True except ImportError: - print "failed=True msg='boto required for this module'" - sys.exit(1) + HAS_BOTO = False def arn_topic_lookup(connection, short_topic): @@ -140,6 +140,9 @@ def main(): module = AnsibleModule(argument_spec=argument_spec) + if not HAS_BOTO: + module.fail_json(msg='boto required for this module') + msg = module.params['msg'] subject = module.params['subject'] topic = module.params['topic']