From 91341de22078d64a66a33fec89a5a2e665d5228b Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Tue, 26 Sep 2017 16:09:25 -0400 Subject: [PATCH] [cloudwatch_event] Due to an ImportError botocore is never successfully imported. (#30942) --- lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py | 5 ++--- 1 file 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 cc2ae97f372..24a063b31c4 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))