diff options
author | Timur Alperovich <timur@timuralp.com> | 2018-07-24 11:53:25 -0700 |
---|---|---|
committer | Timur Alperovich <timur@timuralp.com> | 2018-07-24 11:53:25 -0700 |
commit | e28b12a1f2156b2e8a790290ae6da08adde3875f (patch) | |
tree | 1ab0cf74f1003b54d3995701241f52a2eebb068b /swiftclient/client.py | |
parent | 6872b95560ab77b200fde9e322af30bba99c99eb (diff) | |
download | python-swiftclient-e28b12a1f2156b2e8a790290ae6da08adde3875f.tar.gz |
Remove unnecessary calls to parse_header_string().
Since we define the getheader() method on the response from
HTTPConnection, we don't have to call parse_header_string, as the values
will already be converted properly.
Change-Id: Ia81e8674b828b3ff1f014454126b469e41adfc23
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r-- | swiftclient/client.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index 410a001..71801c6 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -529,10 +529,8 @@ def get_auth_1_0(url, user, key, snet, **kwargs): parsed[1] = 'snet-' + netloc url = urlunparse(parsed) - auth_token = resp.getheader('x-auth-token') - if auth_token is not None: - auth_token = parse_header_string(auth_token) - return url, resp.getheader('x-storage-token', auth_token) + token = resp.getheader('x-storage-token', resp.getheader('x-auth-token')) + return url, token def get_keystoneclient_2_0(auth_url, user, key, os_options, **kwargs): @@ -712,14 +710,10 @@ def get_auth(auth_url, user, key, **kwargs): raise ClientException('Unknown auth_version %s specified and no ' 'session found.' % auth_version) - if token is not None: - token = parse_header_string(token) # Override storage url, if necessary if os_options.get('object_storage_url'): return os_options['object_storage_url'], token else: - if storage_url is not None: - return parse_header_string(storage_url), token return storage_url, token |