From 60e2e43f003ab14f33936ba4aee19699d60db546 Mon Sep 17 00:00:00 2001 From: Michael Laccetti Date: Wed, 25 Feb 2015 08:46:13 -0500 Subject: [PATCH] Change s3 to use connect_to_region * Allows us to use Ansible/s3 for GovCloud when accessing a pre-existing bucket --- cloud/amazon/s3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud/amazon/s3.py b/cloud/amazon/s3.py index 7b914dd9117..f3f6e222c66 100644 --- a/cloud/amazon/s3.py +++ b/cloud/amazon/s3.py @@ -339,7 +339,8 @@ def main(): module.fail_json(msg = str(e)) else: try: - s3 = boto.connect_s3(aws_access_key, aws_secret_key) + from boto.s3.connection import OrdinaryCallingFormat + s3 = boto.s3.connect_to_region(location, aws_access_key_id=aws_access_key, aws_secret_access_key=aws_secret_key, is_secure=True, calling_format=OrdinaryCallingFormat()) except boto.exception.NoAuthHandlerFound, e: module.fail_json(msg = str(e))