From 577f56ac798255f580d8c8aabcea6219d5a5d7f3 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 6 May 2016 14:00:32 -0500 Subject: [PATCH] Fix HAS_BOTO fail_json call for ec2_ami_copy --- lib/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py b/lib/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py index ff9bde8802..174ae709b0 100644 --- a/lib/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py +++ b/lib/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py @@ -91,9 +91,6 @@ try: HAS_BOTO = True except ImportError: HAS_BOTO = False - -if not HAS_BOTO: - module.fail_json(msg='boto required for this module') def copy_image(module, ec2): """ @@ -183,6 +180,9 @@ def main(): module = AnsibleModule(argument_spec=argument_spec) + if not HAS_BOTO: + module.fail_json(msg='boto required for this module') + try: ec2 = ec2_connect(module) except boto.exception.NoAuthHandlerFound, e: