From 0d9ef9fe15936d9e01539480b30135f764d343fc Mon Sep 17 00:00:00 2001 From: NiallBunting Date: Fri, 30 Oct 2015 16:42:51 +0000 Subject: Deprecate unused Exceptions There are a lot of exceptions that seem to be unused in the glance_store. This change deprecates all these unused exceptions. Closes-Bug: 1516020 Change-Id: I58e69ddced3ca7fad0a9df8c7f52f5f5c077a844 --- glance_store/exceptions.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/glance_store/exceptions.py b/glance_store/exceptions.py index 45c790d..163e3e9 100644 --- a/glance_store/exceptions.py +++ b/glance_store/exceptions.py @@ -15,11 +15,13 @@ """Glance Store exception subclasses""" +from debtcollector import removals import six import six.moves.urllib.parse as urlparse +import warnings from glance_store import i18n - +warnings.simplefilter('always') _ = i18n._ @@ -97,7 +99,9 @@ class Duplicate(GlanceStoreException): message = _("Image %(image)s already exists") +@removals.remove(version="0.10.0") class Conflict(GlanceStoreException): + """DEPRECATED!""" message = _("An object with the same identifier is currently being " "operated on.") @@ -130,15 +134,21 @@ class Forbidden(GlanceStoreException): message = _("You are not authorized to complete this action.") +@removals.remove(version="0.10.0") class ForbiddenPublicImage(Forbidden): + """DEPRECATED!""" message = _("You are not authorized to complete this action.") +@removals.remove(version="0.10.0") class ProtectedImageDelete(Forbidden): + """DEPRECATED!""" message = _("Image %(image_id)s is protected and cannot be deleted.") class Invalid(GlanceStoreException): + # NOTE(NiallBunting) This could be deprecated however the debtcollector + # seems to have problems deprecating this as well as the subclasses. message = _("Data supplied was not valid.") @@ -151,7 +161,9 @@ class DriverLoadFailure(GlanceStoreException): message = _("Driver %(driver_name)s could not be loaded.") +@removals.remove(version="0.10.0") class BadDriverConfiguration(GlanceStoreException): + """DEPRECATED!""" message = _("Driver %(driver_name)s could not be configured correctly. " "Reason: %(reason)s") @@ -178,7 +190,9 @@ class MaxRedirectsExceeded(GlanceStoreException): message = _("Maximum redirects (%(redirects)s) was exceeded.") +@removals.remove(version="0.10.0") class InvalidRedirect(GlanceStoreException): + """DEPRECATED!""" message = _("Received invalid HTTP redirect.") @@ -196,20 +210,28 @@ class RemoteServiceUnavailable(GlanceStoreException): message = _("Remote server where the image is present is unavailable.") +@removals.remove(version="0.10.0") class WorkerCreationFailure(GlanceStoreException): + """DEPRECATED!""" message = _("Server worker creation failed: %(reason)s.") +@removals.remove(version="0.10.0") class SchemaLoadError(GlanceStoreException): + """DEPRECATED!""" message = _("Unable to load schema: %(reason)s") +@removals.remove(version="0.10.0") class InvalidObject(GlanceStoreException): + """DEPRECATED!""" message = _("Provided object does not match schema " "'%(schema)s': %(reason)s") +@removals.remove(version="0.10.0") class UnsupportedHeaderFeature(GlanceStoreException): + """DEPRECATED!""" message = _("Provided header feature is unsupported: %(feature)s") @@ -222,15 +244,21 @@ class InUseByStore(GlanceStoreException): "the backend store outside of Glance.") +@removals.remove(version="0.10.0") class ImageDataNotFound(NotFound): + """DEPRECATED!""" message = _("No image data could be found") +@removals.remove(version="0.10.0") class InvalidParameterValue(Invalid): + """DEPRECATED!""" message = _("Invalid value '%(value)s' for parameter '%(param)s': " "%(extra_msg)s") +@removals.remove(version="0.10.0") class InvalidImageStatusTransition(Invalid): + """DEPRECATED!""" message = _("Image status transition from %(cur_status)s to" " %(new_status)s is not allowed") -- cgit v1.2.1