diff --git a/cinderclient/client.py b/cinderclient/client.py index 90abc674d..aef00ef88 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -307,8 +307,7 @@ class HTTPClient(object): 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: diff --git a/cinderclient/openstack/common/apiclient/client.py b/cinderclient/openstack/common/apiclient/client.py index ec9c6d5aa..3741df913 100644 --- a/cinderclient/openstack/common/apiclient/client.py +++ b/cinderclient/openstack/common/apiclient/client.py @@ -144,11 +144,7 @@ class HTTPClient(object): def serialize(self, kwargs): if kwargs.get('json') is not None: kwargs['headers']['Content-Type'] = 'application/json' - kwargs['data'] = json.dumps(kwargs['json']) - try: - del kwargs['json'] - except KeyError: - pass + kwargs['data'] = json.dumps(kwargs.pop('json')) def get_timings(self): return self.times