summaryrefslogtreecommitdiff
path: root/keystoneclient/v2_0/client.py
diff options
context:
space:
mode:
authorJay Pipes <jaypipes@gmail.com>2012-10-17 14:52:48 -0400
committerJay Pipes <jaypipes@gmail.com>2012-10-17 14:52:48 -0400
commita6102fe0b9cc177c8164ea0fb39286a4b27c6c79 (patch)
tree6bf962f86a7547d488c78cd5d0ba93cadf18bc99 /keystoneclient/v2_0/client.py
parentfc4cbcae39ee094cef2c3cce4c96813eb9affcff (diff)
downloadpython-keystoneclient-a6102fe0b9cc177c8164ea0fb39286a4b27c6c79.tar.gz
Ensure JSON isn't read on no HTTP response body
This patch moves the json.loads(body) call in the HTTP response handling to after the check for non- 200-300 return codes. This gets rid of the ValueError exception raise when you hit, for instance, a 400 or 404. Also changes a number of logger.exception() calls to logger.debug() calls, since some exceptions are expected and should not be logged as exceptions per-se. fixes LP bug#1067512 Change-Id: If66fb1846ddc19da5bc2f15c6e0dd09019a56932
Diffstat (limited to 'keystoneclient/v2_0/client.py')
-rw-r--r--keystoneclient/v2_0/client.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py
index 1308872..fef1178 100644
--- a/keystoneclient/v2_0/client.py
+++ b/keystoneclient/v2_0/client.py
@@ -106,9 +106,9 @@ class Client(client.HTTPClient):
self._extract_service_catalog(self.auth_url, raw_token)
return True
except (exceptions.AuthorizationFailure, exceptions.Unauthorized):
+ _logger.debug("Authorization Failed.")
raise
except Exception, e:
- _logger.exception("Authorization Failed.")
raise exceptions.AuthorizationFailure("Authorization Failed: "
"%s" % e)