summaryrefslogtreecommitdiff
path: root/heatclient/exc.py
diff options
context:
space:
mode:
authorChmouel Boudjnah <chmouel@enovance.com>2014-01-09 11:05:22 +0100
committerRandall Burt <randall.burt@rackspace.com>2014-02-07 14:52:22 -0600
commita2ff9eaeed983ff3bacf60ce32c6bc1e95cff5b5 (patch)
tree01f97722abba9bd89ccd959041b739a334acc728 /heatclient/exc.py
parent6a19658a9dc7068cf3cb7513f3ed9ce2c1fdae44 (diff)
downloadpython-heatclient-a2ff9eaeed983ff3bacf60ce32c6bc1e95cff5b5.tar.gz
Port to python requests
Since python requests has builtins SSL verification we can get ride of our own implementation. Increase tests coverage of heatclient.common.http along the way. Partial Implements: blueprint python-requests-port Change-Id: I04a169da2334acc91e538ca02cba79d9765752b5
Diffstat (limited to 'heatclient/exc.py')
-rw-r--r--heatclient/exc.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/heatclient/exc.py b/heatclient/exc.py
index c3d4117..fd2f334 100644
--- a/heatclient/exc.py
+++ b/heatclient/exc.py
@@ -169,11 +169,10 @@ for obj_name in dir(sys.modules[__name__]):
_code_map[obj.code] = obj
-def from_response(response, body_iter):
- """Return an instance of an HTTPException based on httplib response."""
- cls = _code_map.get(response.status, HTTPException)
- body_str = ''.join([chunk for chunk in body_iter])
- return cls(body_str)
+def from_response(response):
+ """Return an instance of an HTTPException based on requests response."""
+ cls = _code_map.get(response.status_code, HTTPException)
+ return cls(response.content)
class NoTokenLookupException(Exception):