From 92fd2dbfb672d7b2b1cdfd5dd5cf89f7716b3e12 Mon Sep 17 00:00:00 2001 From: asteroide Date: Tue, 1 Sep 2015 16:03:26 +0200 Subject: Update Keystone code from official Github repository with branch Master on 09/01/2015. Change-Id: I0ff6099e6e2580f87f502002a998bbfe12673498 --- keystone-moon/keystone/exception.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'keystone-moon/keystone/exception.py') 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): -- cgit 1.2.3-korg