summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
diff options
context:
space:
mode:
authorBhuvan Arumugam <bhuvan@apache.org>2012-09-08 22:59:13 -0700
committerGerrit Code Review <review@openstack.org>2012-09-24 19:21:58 +0000
commit15d134d13015b17c48a0e138f01808d9698bbe89 (patch)
tree33318c2376b77cfeb8daa173460607db2a539a90 /keystoneclient/exceptions.py
parentc784105148bf4b860f4773cd349d1a0a7c53f050 (diff)
downloadpython-keystoneclient-15d134d13015b17c48a0e138f01808d9698bbe89.tar.gz
Handle "503 Service Unavailable" exception.
Bug: 1028799 No traceback, if service is unavailable; error out gracefully. * keystoneclient/exceptions.py ServiceUnavailable: New class to handle 503 status code. Add the new class to list of handled exceptions. Change-Id: I39a8ac594ef922d682731a926be26c8b6f648f9d
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r--keystoneclient/exceptions.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index d01f3d2..f992ff3 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -95,6 +95,14 @@ class HTTPNotImplemented(ClientException):
message = "Not Implemented"
+class ServiceUnavailable(ClientException):
+ """
+ HTTP 503 - Service Unavailable: The server is currently unavailable.
+ """
+ http_status = 503
+ message = "Service Unavailable"
+
+
# In Python 2.4 Exception is old-style and thus doesn't have a __subclasses__()
# so we can do this:
# _code_map = dict((c.http_status, c)
@@ -106,7 +114,8 @@ _code_map = dict((c.http_status, c) for c in [BadRequest,
Forbidden,
NotFound,
OverLimit,
- HTTPNotImplemented])
+ HTTPNotImplemented,
+ ServiceUnavailable])
def from_response(response, body):