diff options
author | Charles Hsu <charles0126@gmail.com> | 2015-02-07 08:51:40 +0800 |
---|---|---|
committer | Charles Hsu <charles0126@gmail.com> | 2015-02-07 11:42:49 +0800 |
commit | df2442166ceb63533f32073a5a2eea146eddb6a9 (patch) | |
tree | fc6ca02fafd694b884fc8720fb37707af1b876e5 | |
parent | 06c73c6020e5af873e3ce245a27035da3448de7b (diff) | |
download | python-swiftclient-df2442166ceb63533f32073a5a2eea146eddb6a9.tar.gz |
Fix missing ca-certificate parameter to get_auth.
Missing cacert parameter in get_auth_1_0() and it makes requests_args['verify']
is True in default(likes "swift --os-cacert ssl.crti list").
The requests_args['verify'] should be a ca-certificate file name("ssl.crt").
Change-Id: Id3110f3818f55922ad19eeb1ead80fface824009
Closes-Bug: 1418473
-rw-r--r-- | swiftclient/client.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 40cb9fe..d0ff52e 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -247,8 +247,9 @@ def http_connection(*arg, **kwarg): def get_auth_1_0(url, user, key, snet, **kwargs): + cacert = kwargs.get('cacert', None) insecure = kwargs.get('insecure', False) - parsed, conn = http_connection(url, insecure=insecure) + parsed, conn = http_connection(url, cacert=cacert, insecure=insecure) method = 'GET' conn.request(method, parsed.path, '', {'X-Auth-User': user, 'X-Auth-Key': key}) @@ -374,12 +375,14 @@ def get_auth(auth_url, user, key, **kwargs): os_options = kwargs.get('os_options', {}) storage_url, token = None, None + cacert = kwargs.get('cacert', None) insecure = kwargs.get('insecure', False) if auth_version in AUTH_VERSIONS_V1: storage_url, token = get_auth_1_0(auth_url, user, key, kwargs.get('snet'), + cacert=cacert, insecure=insecure) elif auth_version in AUTH_VERSIONS_V2 + AUTH_VERSIONS_V3: # We are handling a special use case here where the user argument @@ -400,7 +403,6 @@ def get_auth(auth_url, user, key, **kwargs): raise ClientException('No tenant specified') raise ClientException('No project name or project id specified.') - cacert = kwargs.get('cacert', None) storage_url, token = get_auth_keystone(auth_url, user, key, os_options, cacert=cacert, |