summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-02-19 03:47:56 +0000
committerGerrit Code Review <review@openstack.org>2014-02-19 03:47:56 +0000
commitd5558265cc97af3fc48eb71a99816a04cd17a0d8 (patch)
tree7b109af2b9db07ebeff284d50851313ebae4c693
parent298a0e55a34495880ba1bef4050b7a8472ee454e (diff)
parent3d614875dd9cd8822482d88d434cbfc88bd5f05e (diff)
downloadpython-neutronclient-2.3.4.tar.gz
Merge "Don't reuse 'body' for response data"2.3.4
-rw-r--r--neutronclient/client.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/neutronclient/client.py b/neutronclient/client.py
index f6faba7..5d32280 100644
--- a/neutronclient/client.py
+++ b/neutronclient/client.py
@@ -234,22 +234,22 @@ class HTTPClient(httplib2.Http):
tmp_follow_all_redirects = self.follow_all_redirects
self.follow_all_redirects = True
try:
- resp, body = self._cs_request(token_url, "POST",
- body=json.dumps(body),
- content_type="application/json")
+ resp, resp_body = self._cs_request(token_url, "POST",
+ body=json.dumps(body),
+ content_type="application/json")
finally:
self.follow_all_redirects = tmp_follow_all_redirects
status_code = self.get_status_code(resp)
if status_code != 200:
- raise exceptions.Unauthorized(message=body)
- if body:
+ raise exceptions.Unauthorized(message=resp_body)
+ if resp_body:
try:
- body = json.loads(body)
+ resp_body = json.loads(resp_body)
except ValueError:
pass
else:
- body = None
- self._extract_service_catalog(body)
+ resp_body = None
+ self._extract_service_catalog(resp_body)
def _get_endpoint_url(self):
url = self.auth_url + '/tokens/%s/endpoints' % self.auth_token