summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
diff options
context:
space:
mode:
authorAndrey Kurilin <akurilin@mirantis.com>2014-02-17 12:06:36 +0200
committerAndrey Kurilin <akurilin@mirantis.com>2014-04-01 08:26:47 +0300
commit61544f01d4237e34a415a4b2879d4c1a4891c968 (patch)
tree7da7398a8ab52ec54fbbdf7d4429c97c89cd2acf /keystoneclient/exceptions.py
parentc1f519dc450b63ba7e4bc2898f59eb34dc118cf1 (diff)
downloadpython-keystoneclient-61544f01d4237e34a415a4b2879d4c1a4891c968.tar.gz
Reuse module `exceptions` from Oslo
The exception module in oslo common code and in keystoneclient are similar. In case of unification openstack clients, we should use modules from Oslo. Changes of this patch: - imported exceptions from common code instead of `apiclient.exception` - added aliases for exceptions which was renamed (reason: backwards compatibility) - moved exceptions `EmptyCatalog` from `apiclient.exception` to `exceptions` - cleaned `apiclient.exception` from duplicated exceptions - `apiclient.__init__` and `apiclient.exceptions` are kept and labeled as 'deprecated'(reason: backwards compatibility) bp common-client-library-2 Change-Id: Iedf4e5d753d4278d81751ba0f55fdef3566b56de
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r--keystoneclient/exceptions.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index c462074..c688fac 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -17,7 +17,14 @@ Exception definitions.
"""
#flake8: noqa
-from keystoneclient.apiclient.exceptions import *
+from keystoneclient.openstack.common.apiclient.exceptions import *
+
+# NOTE(akurilin): This alias should be left here to support backwards
+# compatibility until we are sure that usage of these exceptions in
+# projects is correct.
+ConnectionError = ConnectionRefused
+HTTPNotImplemented = HttpNotImplemented
+Timeout = RequestTimeout
class CertificateConfigError(Exception):
@@ -29,18 +36,15 @@ class CertificateConfigError(Exception):
super(CertificateConfigError, self).__init__(msg)
-class ConnectionError(ClientException):
- """Something went wrong trying to connect to a server"""
+class EmptyCatalog(EndpointNotFound):
+ """The service catalog is empty."""
+ pass
-class SSLError(ConnectionError):
+class SSLError(ConnectionRefused):
"""An SSL error occurred."""
-class Timeout(ClientException):
- """The request timed out."""
-
-
class DiscoveryFailure(ClientException):
"""Discovery of client versions failed."""