diff options
author | bhagyashris <bhagyashri.shewale@nttdata.com> | 2016-08-22 12:36:56 +0530 |
---|---|---|
committer | bhagyashris <bhagyashri.shewale@nttdata.com> | 2016-08-24 11:56:56 +0530 |
commit | 744c9b6adaf51d689ad589e0c727bf800d00628a (patch) | |
tree | f262bfe36b532dc043d907df26761e2efdc6e28c /novaclient/client.py | |
parent | 3b834f25c1d31ef482116344f97b0a1059d9a836 (diff) | |
download | python-novaclient-744c9b6adaf51d689ad589e0c727bf800d00628a.tar.gz |
Replace functions 'Dict.get' and 'del' with 'Dict.pop'
Refactoring code: Making 'kwargs' dict to use single instruction: pop()
rather than two instructions: get() and del, giving the codes a format
that carries through.
TrivialFix
Change-Id: Icaf4a57314a8fe48f51993d7b32a1671fec40f31
Diffstat (limited to 'novaclient/client.py')
-rw-r--r-- | novaclient/client.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/novaclient/client.py b/novaclient/client.py index 1668af46..2e5f125a 100644 --- a/novaclient/client.py +++ b/novaclient/client.py @@ -377,8 +377,7 @@ class HTTPClient(object): kwargs['headers']['Accept'] = 'application/json' if 'body' in kwargs: kwargs['headers']['Content-Type'] = 'application/json' - kwargs['data'] = json.dumps(kwargs['body']) - del kwargs['body'] + kwargs['data'] = json.dumps(kwargs.pop('body')) api_versions.update_headers(kwargs["headers"], self.api_version) if self.timeout is not None: kwargs.setdefault('timeout', self.timeout) |