Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GSBotoStorage connection kwargs #342

Merged
merged 1 commit into from
Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions storages/backends/gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class GSBotoStorage(S3BotoStorage):
url_protocol = setting('GS_URL_PROTOCOL', 'http:')
host = setting('GS_HOST', GSConnection.DefaultHost)

def _get_connection_kwargs(self):
kwargs = super(GSBotoStorage, self)._get_connection_kwargs()
del kwargs['security_token']
return kwargs

def _save_content(self, key, content, headers):
# only pass backwards incompatible arguments if they vary from the default
options = {}
Expand Down
21 changes: 14 additions & 7 deletions storages/backends/s3boto.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,26 @@ def __init__(self, acl=None, bucket=None, **settings):
@property
def connection(self):
if self._connection is None:
kwargs = self._get_connection_kwargs()

self._connection = self.connection_class(
self.access_key,
self.secret_key,
security_token=self.security_token,
is_secure=self.use_ssl,
calling_format=self.calling_format,
host=self.host,
port=self.port,
proxy=self.proxy,
proxy_port=self.proxy_port
**kwargs
)
return self._connection

def _get_connection_kwargs(self):
return dict(
security_token=self.security_token,
is_secure=self.use_ssl,
calling_format=self.calling_format,
host=self.host,
port=self.port,
proxy=self.proxy,
proxy_port=self.proxy_port
)

@property
def bucket(self):
"""
Expand Down