From 7de97864bec4d3c904b2ae983eff40b5d6785ee9 Mon Sep 17 00:00:00 2001 From: Mick Bass Date: Sun, 29 Mar 2015 21:56:44 -0600 Subject: [PATCH] clean rebase of https://github.com/ansible/ansible-modules-core/pull/1024 on a new branch --- cloud/amazon/s3.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/amazon/s3.py b/cloud/amazon/s3.py index c24021f1902..e7d017f58ea 100644 --- a/cloud/amazon/s3.py +++ b/cloud/amazon/s3.py @@ -320,12 +320,12 @@ def main(): ) elif is_walrus(s3_url): walrus = urlparse.urlparse(s3_url).hostname - s3 = boto.connect_walrus(walrus, aws_access_key, aws_secret_key) + s3 = boto.connect_walrus(walrus, **aws_connect_kwargs) else: - s3 = boto.s3.connection.S3Connection(calling_format=OrdinaryCallingFormat(), **aws_connect_kwargs) + s3 = boto.s3.connect_to_region(location, is_secure=True, calling_format=OrdinaryCallingFormat(), **aws_connect_kwargs) # use this as fallback because connect_to_region seems to fail in boto + non 'classic' aws accounts in some cases if s3 is None: - s3 = boto.connect_s3(aws_access_key, aws_secret_key) + s3 = boto.connect_s3(**aws_connect_kwargs) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg='No Authentication Handler found: %s ' % str(e))