From 6ae201d3b12a0cf005c7c7cf92128c52e648cfbd Mon Sep 17 00:00:00 2001 From: s-hertel Date: Wed, 6 Sep 2017 11:18:16 -0400 Subject: [PATCH] cloudtrail: import botocore.exceptions in a try/except. --- lib/ansible/modules/cloud/amazon/cloudtrail.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudtrail.py b/lib/ansible/modules/cloud/amazon/cloudtrail.py index 337f8b756a..05f4218ef0 100644 --- a/lib/ansible/modules/cloud/amazon/cloudtrail.py +++ b/lib/ansible/modules/cloud/amazon/cloudtrail.py @@ -245,7 +245,11 @@ trail: import traceback -from botocore.exceptions import ClientError +try: + from botocore.exceptions import ClientError +except ImportError: + # Handled in main() by imported HAS_BOTO3 + pass from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ec2 import (boto3_conn, ec2_argument_spec, get_aws_connection_info,