diff options
author | bhagyashris <bhagyashri.shewale@nttdata.com> | 2016-08-26 15:42:57 +0530 |
---|---|---|
committer | bhagyashris <bhagyashri.shewale@nttdata.com> | 2017-01-31 10:09:28 +0530 |
commit | 6740f570963d742f4f62bccbd9d8da301982712f (patch) | |
tree | 51d0213632ba66994d04062e1f314ec6b00aed14 /glanceclient | |
parent | c1f54742f9ed61cd33e1f20342583bee07f1dfae (diff) | |
download | python-glanceclient-6740f570963d742f4f62bccbd9d8da301982712f.tar.gz |
Replace functions 'dict.get' and 'del' with 'dict.pop'
Refactoring code: Making dict to use single instruction: pop()
rather than two instructions: get() and del, giving the codes a
format that carries through.
TrivialRefactoring
Change-Id: Idb21df37c287fdff24c29153676f82544f735297
Diffstat (limited to 'glanceclient')
-rw-r--r-- | glanceclient/common/http.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py index 67a8d06..c19f5b4 100644 --- a/glanceclient/common/http.py +++ b/glanceclient/common/http.py @@ -141,9 +141,8 @@ class HTTPClient(_BaseHTTPClient): self.auth_token = kwargs.get('token') self.language_header = kwargs.get('language_header') if self.identity_headers: - if self.identity_headers.get('X-Auth-Token'): - self.auth_token = self.identity_headers.get('X-Auth-Token') - del self.identity_headers['X-Auth-Token'] + self.auth_token = self.identity_headers.pop('X-Auth-Token', + self.auth_token) self.session = requests.Session() self.session.headers["User-Agent"] = USER_AGENT |