summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py b/lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py
index cc2ae97f37..24a063b31c 100644
--- a/lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py
+++ b/lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py
@@ -116,8 +116,7 @@ targets:
''' # NOQA
try:
- import boto3.exception
- import botocore.exceptions
+ import botocore
except ImportError:
# module_utils.ec2.HAS_BOTO3 will do the right thing
pass
@@ -379,7 +378,7 @@ def get_cloudwatchevents_client(module):
resource='events',
region=region, endpoint=ec2_url,
**aws_conn_kwargs)
- except boto3.exception.NoAuthHandlerFound as e:
+ except botocore.exceptions.ProfileNotFound as e:
module.fail_json(msg=str(e))