summaryrefslogtreecommitdiff
path: root/heatclient/common/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'heatclient/common/http.py')
-rw-r--r--heatclient/common/http.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py
index 576e364..16d1bf6 100644
--- a/heatclient/common/http.py
+++ b/heatclient/common/http.py
@@ -160,7 +160,7 @@ class HTTPClient(object):
self.log_http_response(resp, body_str)
if 400 <= resp.status < 600:
- raise exc.from_response(resp, body_iter)
+ raise exc.from_response(resp, body_str)
elif resp.status in (301, 302, 305):
# Redirected. Reissue the request to the new location.
location = resp.getheader('location', None)
@@ -175,7 +175,7 @@ class HTTPClient(object):
raise exc.InvalidEndpoint(message=message)
return self._http_request(location, method, **kwargs)
elif resp.status == 300:
- raise exc.from_response(resp, body_iter)
+ raise exc.from_response(resp, body_str)
return resp, body_str
@@ -187,10 +187,10 @@ class HTTPClient(object):
if 'body' in kwargs:
kwargs['body'] = json.dumps(kwargs['body'])
- resp, body_iter = self._http_request(url, method, **kwargs)
+ resp, body_str = self._http_request(url, method, **kwargs)
if 'application/json' in resp.getheader('content-type', None):
- body = ''.join([chunk for chunk in body_iter])
+ body = body_str
try:
body = json.loads(body)
except ValueError: