summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Brown <sb@ryansb.com>2018-02-21 23:18:41 -0500
committerSloane Hertel <shertel@redhat.com>2018-02-21 23:18:41 -0500
commitc4e94af4e9836a76d4a0cdd571690e55825e0778 (patch)
tree3d34900aeba4c553aebe348973bee93cae32756f
parente93cc41211dfae792b8842ca638a4381c209e97b (diff)
downloadansible-c4e94af4e9836a76d4a0cdd571690e55825e0778.tar.gz
[cloud] catch NoCredentialsError in boto3_conn (#36545)
-rw-r--r--lib/ansible/module_utils/ec2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py
index 35030b22c8..33f7f79b03 100644
--- a/lib/ansible/module_utils/ec2.py
+++ b/lib/ansible/module_utils/ec2.py
@@ -106,7 +106,7 @@ def boto3_conn(module, conn_type=None, resource=None, region=None, endpoint=None
return _boto3_conn(conn_type=conn_type, resource=resource, region=region, endpoint=endpoint, **params)
except ValueError as e:
module.fail_json(msg="Couldn't connect to AWS: %s" % to_native(e))
- except (botocore.exceptions.ProfileNotFound, botocore.exceptions.PartialCredentialsError) as e:
+ except (botocore.exceptions.ProfileNotFound, botocore.exceptions.PartialCredentialsError, botocore.exceptions.NoCredentialsError) as e:
module.fail_json(msg=to_native(e))
except botocore.exceptions.NoRegionError as e:
module.fail_json(msg="The %s module requires a region and none was found in configuration, "