summaryrefslogtreecommitdiff
path: root/neutronclient/client.py
diff options
context:
space:
mode:
authorRobert Collins <rbtcollins@hp.com>2014-01-25 20:59:29 +1300
committerMark McClain <mmcclain@yahoo-inc.com>2014-02-18 12:17:40 -0500
commit3d614875dd9cd8822482d88d434cbfc88bd5f05e (patch)
tree3b56c62f88630c6f775591f87736f9438b92ab45 /neutronclient/client.py
parentd661414a43b60ffdcd1df18bc8d5da773e49e912 (diff)
downloadpython-neutronclient-3d614875dd9cd8822482d88d434cbfc88bd5f05e.tar.gz
Don't reuse 'body' for response data
It makes diagnostics in debuggers much harder - we can just use a different variable name instead. Change-Id: I69367336cbb0f9f302ef8d484a5d504d2b3869bb
Diffstat (limited to 'neutronclient/client.py')
-rw-r--r--neutronclient/client.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/neutronclient/client.py b/neutronclient/client.py
index f89b2ef..f0902eb 100644
--- a/neutronclient/client.py
+++ b/neutronclient/client.py
@@ -235,22 +235,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