[cloud] Don't remove profile, security_token by default in aws_s3 (#30902)

Comment above suggests only removing it for non-S3 services,
so let's actually enforce that.
This commit is contained in:
Will Thames 2017-09-27 00:18:30 +10:00 committed by Ryan Brown
parent ef56f9a44c
commit b863d072c2

View file

@ -604,8 +604,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: