Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 0a6f122

Browse files
committed
Fix S3 storage_redirect: true
Docker-DCO-1.1-Signed-off-by: Fernando Mayo <[email protected]> (github: fermayo)
1 parent d8276be commit 0a6f122

File tree

1 file changed

+11
-8
lines changed
  • docker_registry/drivers

1 file changed

+11
-8
lines changed

docker_registry/drivers/s3.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ def _build_connection_params(self):
7272

7373
def makeConnection(self):
7474
kwargs = self._build_connection_params()
75-
if self._config.s3_region is not None:
76-
return boto.s3.connect_to_region(
77-
region_name=self._config.s3_region,
78-
aws_access_key_id=self._config.s3_access_key,
79-
aws_secret_access_key=self._config.s3_secret_key,
80-
**kwargs)
81-
logger.warn("No S3 region specified, using boto default region, " +
82-
"this may affect performance and stability.")
8375
# Connect cloudfront if we are required to
8476
if self._config.cloudfront:
8577
self.signer = Cloudfront(
@@ -89,6 +81,17 @@ def makeConnection(self):
8981
self._config.cloudfront['keyid'],
9082
self._config.cloudfront['keysecret']
9183
).sign
84+
else:
85+
self.signer = None
86+
87+
if self._config.s3_region is not None:
88+
return boto.s3.connect_to_region(
89+
region_name=self._config.s3_region,
90+
aws_access_key_id=self._config.s3_access_key,
91+
aws_secret_access_key=self._config.s3_secret_key,
92+
**kwargs)
93+
logger.warn("No S3 region specified, using boto default region, " +
94+
"this may affect performance and stability.")
9295

9396
return boto.s3.connection.S3Connection(
9497
self._config.s3_access_key,

0 commit comments

Comments
 (0)