diff options
author | Sloane Hertel <shertel@redhat.com> | 2017-09-26 16:10:37 -0400 |
---|---|---|
committer | Ryan Brown <sb@ryansb.com> | 2017-09-26 16:10:37 -0400 |
commit | 0195d3640bf2b7d62340e1853a1bdd231df921c2 (patch) | |
tree | 75cbf616bcb793e74df114128bc5d1a666118ecb | |
parent | ed2a152b5e3322a20029e11780ec6bee52e478e3 (diff) | |
download | ansible-0195d3640bf2b7d62340e1853a1bdd231df921c2.tar.gz |
[cloud] Don't remove profile, security_token by default in `aws_s3` (#30902) (#30930)
Comment above suggests only removing it for non-S3 services,
so let's actually enforce that.
-rw-r--r-- | lib/ansible/modules/cloud/amazon/aws_s3.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/modules/cloud/amazon/aws_s3.py b/lib/ansible/modules/cloud/amazon/aws_s3.py index 7b2ad3f8e9..9d5ba2971c 100644 --- a/lib/ansible/modules/cloud/amazon/aws_s3.py +++ b/lib/ansible/modules/cloud/amazon/aws_s3.py @@ -605,8 +605,9 @@ def main(): # Look at s3_url and tweak connection settings # if connecting to RGW, Walrus or fakes3 - for key in ['validate_certs', 'security_token', 'profile_name']: - aws_connect_kwargs.pop(key, None) + if s3_url: + for key in ['validate_certs', 'security_token', 'profile_name']: + aws_connect_kwargs.pop(key, None) try: s3 = get_s3_connection(module, aws_connect_kwargs, location, rgw, s3_url) except (botocore.exceptions.NoCredentialsError, botocore.exceptions.ProfileNotFound) as e: |