diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-08-09 02:39:51 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-08-09 02:39:51 +0000 |
commit | 565c05cce1010e682488e79dd33f801bbdd72610 (patch) | |
tree | 69e4d6cbc64b1eaa5798221fbcf2cc5a40cc0594 /heatclient/common | |
parent | 804ab3e552771a50bbef3dfacdec0d1fa0573406 (diff) | |
parent | 485a679f3e87d5e38a72c4da07f5fb3ecd6597c8 (diff) | |
download | python-heatclient-565c05cce1010e682488e79dd33f801bbdd72610.tar.gz |
Merge "Decode content before checking"
Diffstat (limited to 'heatclient/common')
-rw-r--r-- | heatclient/common/http.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py index f5c5021..4b765df 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -221,10 +221,10 @@ class HTTPClient(object): raise exc.CommunicationError(message=message) self.log_http_response(resp) - + txt_content = encodeutils.safe_decode(resp.content, 'utf-8') if not ('X-Auth-Key' in kwargs['headers']) and ( resp.status_code == 401 or - (resp.status_code == 500 and "(HTTP 401)" in resp.content)): + (resp.status_code == 500 and "(HTTP 401)" in txt_content)): raise exc.HTTPUnauthorized(_("Authentication failed: %s") % resp.content) elif 400 <= resp.status_code < 600: |