|
@@ -81,8 +81,6 @@ class Client(object):
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
def get_s3_connection(self):
|
|
def get_s3_connection(self):
|
|
|
- # Use V4 signature support by default
|
|
|
|
|
- os.environ['S3_USE_SIGV4'] = 'True'
|
|
|
|
|
|
|
|
|
|
kwargs = {
|
|
kwargs = {
|
|
|
'aws_access_key_id': self._access_key_id,
|
|
'aws_access_key_id': self._access_key_id,
|
|
@@ -105,10 +103,15 @@ class Client(object):
|
|
|
# Attempt to create S3 connection based on configured credentials and host or region first, then fallback to IAM
|
|
# Attempt to create S3 connection based on configured credentials and host or region first, then fallback to IAM
|
|
|
try:
|
|
try:
|
|
|
if self._host is not None:
|
|
if self._host is not None:
|
|
|
|
|
+ # Use V4 signature support by default
|
|
|
|
|
+ os.environ['S3_USE_SIGV4'] = 'True'
|
|
|
kwargs.update({'host': self._host})
|
|
kwargs.update({'host': self._host})
|
|
|
connection = boto.s3.connection.S3Connection(**kwargs)
|
|
connection = boto.s3.connection.S3Connection(**kwargs)
|
|
|
elif self._region:
|
|
elif self._region:
|
|
|
- connection = boto.s3.connect_to_region(self._region, **kwargs)
|
|
|
|
|
|
|
+ connection = boto.s3.connect_to_region(self._region,
|
|
|
|
|
+ aws_access_key_id=self._access_key_id,
|
|
|
|
|
+ aws_secret_access_key=self._secret_access_key,
|
|
|
|
|
+ security_token=self._security_token)
|
|
|
else:
|
|
else:
|
|
|
kwargs.update({'host': 's3.amazonaws.com'})
|
|
kwargs.update({'host': 's3.amazonaws.com'})
|
|
|
connection = boto.s3.connection.S3Connection(**kwargs)
|
|
connection = boto.s3.connection.S3Connection(**kwargs)
|