summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-08-06 09:37:43 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-08-06 09:37:43 -0500
commit4e498a54d0034b2ce5c87130f080ff580d241600 (patch)
treed21d11091373e80bf1a4f70ecf1ee54ff82e0ff8 /keystoneclient/exceptions.py
parentd5c5423d6de3710e3480e47062333b33e8de0713 (diff)
parenteae8e83f5a7a170b98ef2d74a4ffd9eac7cc47ba (diff)
downloadpython-keystoneclient-feature/keystoneauth_integration.tar.gz
Merge remote-tracking branch 'origin/master' into merge-branchfeature/keystoneauth_integration
Conflicts: keystoneclient/exceptions.py keystoneclient/fixture/discovery.py keystoneclient/fixture/v2.py keystoneclient/fixture/v3.py keystoneclient/middleware/auth_token.py keystoneclient/middleware/s3_token.py keystoneclient/tests/unit/test_auth_token_middleware.py keystoneclient/tests/unit/test_memcache_crypt.py keystoneclient/tests/unit/test_s3_token_middleware.py requirements.txt test-requirements.txt Change-Id: Ib51acebaac7966bf37c1562fa15b9061df6a7aa5
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r--keystoneclient/exceptions.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index d01ff74..e140a5e 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -12,20 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Exception definitions.
-
-.. py:exception:: AuthorizationFailure
-
-.. py:exception:: ClientException
-
-.. py:exception:: HttpError
-
-.. py:exception:: ValidationError
-
-.. py:exception:: Unauthorized
-
-"""
+"""Exception definitions."""
from keystoneauth1 import exceptions as new_exceptions
@@ -68,7 +55,6 @@ GatewayTimeout = new_exceptions.GatewayTimeout
HttpVersionNotSupported = new_exceptions.HttpVersionNotSupported
from_response = new_exceptions.from_response
-
# NOTE(jamielennox): Rahh! this is just wrong. In the apiclient conversion
# someone mapped the connection timeout onto the HTTP timeout exception. Assume
# people want the connection timeout as this is much more common.
@@ -82,9 +68,7 @@ Timeout = new_exceptions.ConnectTimeout
# 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.
-ConnectionRefused = ConnectionError
HTTPNotImplemented = HttpNotImplemented
-Timeout = RequestTimeout
HTTPError = HttpError
@@ -105,19 +89,27 @@ class MultipleChoices(HTTPRedirection):
class ValidationError(ClientException):
"""Error in validation on API client side."""
+ pass
class UnsupportedVersion(ClientException):
"""User is trying to use an unsupported version of the API."""
+ pass
class CommandError(ClientException):
"""Error in CLI tool."""
+ pass
AuthorizationFailure = new_exceptions.AuthorizationFailure
+class ConnectionRefused(ConnectionError):
+ """Connection refused while trying to connect to API service."""
+ pass
+
+
class AuthPluginOptionsMissing(AuthorizationFailure):
"""Auth plugin misses some options."""
def __init__(self, opt_names):
@@ -131,7 +123,7 @@ class AuthSystemNotFound(AuthorizationFailure):
"""User has specified an AuthSystem that is not installed."""
def __init__(self, auth_system):
super(AuthSystemNotFound, self).__init__(
- _("AuthSystemNotFound: %s") % repr(auth_system))
+ _("AuthSystemNotFound: %r") % auth_system)
self.auth_system = auth_system
@@ -165,7 +157,7 @@ class AmbiguousEndpoints(EndpointException):
"""Found more than one matching endpoint in Service Catalog."""
def __init__(self, endpoints=None):
super(AmbiguousEndpoints, self).__init__(
- _("AmbiguousEndpoints: %s") % repr(endpoints))
+ _("AmbiguousEndpoints: %r") % endpoints)
self.endpoints = endpoints