aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/exception.py
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-09-01 16:03:26 +0200
committerasteroide <thomas.duval@orange.com>2015-09-01 16:04:53 +0200
commit92fd2dbfb672d7b2b1cdfd5dd5cf89f7716b3e12 (patch)
tree7ba22297042019e7363fa1d4ad26d1c32c5908c6 /keystone-moon/keystone/exception.py
parent26e753254f3e43399cc76e62892908b7742415e8 (diff)
Update Keystone code from official Github repository with branch Master on 09/01/2015.
Change-Id: I0ff6099e6e2580f87f502002a998bbfe12673498
Diffstat (limited to 'keystone-moon/keystone/exception.py')
-rw-r--r--keystone-moon/keystone/exception.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/keystone-moon/keystone/exception.py b/keystone-moon/keystone/exception.py
index 6749fdcd..8e573c4c 100644
--- a/keystone-moon/keystone/exception.py
+++ b/keystone-moon/keystone/exception.py
@@ -15,7 +15,6 @@
from oslo_config import cfg
from oslo_log import log
from oslo_utils import encodeutils
-import six
from keystone.i18n import _, _LW
@@ -63,7 +62,7 @@ class Error(Exception):
except UnicodeDecodeError:
try:
kwargs = {k: encodeutils.safe_decode(v)
- for k, v in six.iteritems(kwargs)}
+ for k, v in kwargs.items()}
except UnicodeDecodeError:
# NOTE(jamielennox): This is the complete failure case
# at least by showing the template we have some idea
@@ -84,6 +83,11 @@ class ValidationError(Error):
title = 'Bad Request'
+class URLValidationError(ValidationError):
+ message_format = _("Cannot create an endpoint with an invalid URL:"
+ " %(url)s")
+
+
class SchemaValidationError(ValidationError):
# NOTE(lbragstad): For whole OpenStack message consistency, this error
# message has been written in a format consistent with WSME.
@@ -99,6 +103,15 @@ class ValidationTimeStampError(Error):
title = 'Bad Request'
+class ValidationExpirationError(Error):
+ message_format = _("The 'expires_at' must not be before now."
+ " The server could not comply with the request"
+ " since it is either malformed or otherwise"
+ " incorrect. The client is assumed to be in error.")
+ code = 400
+ title = 'Bad Request'
+
+
class StringLengthExceeded(ValidationError):
message_format = _("String length exceeded.The length of"
" string '%(string)s' exceeded the limit"
@@ -448,9 +461,9 @@ class MigrationNotProvided(Exception):
) % {'mod_name': mod_name, 'path': path})
-class UnsupportedTokenVersionException(Exception):
- """Token version is unrecognizable or unsupported."""
- pass
+class UnsupportedTokenVersionException(UnexpectedError):
+ message_format = _('Token version is unrecognizable or '
+ 'unsupported.')
class SAMLSigningError(UnexpectedError):