Skip to content

Commit

Permalink
Remove unused exceptions
Browse files Browse the repository at this point in the history
This patch cleans up cinder.exception module by deleting unused
execptions from it.

Change-Id: Idb07d69475306f43116977b5fb9b0ea863c1f65b
  • Loading branch information
e0ne committed Jul 21, 2020
1 parent 33a25e2 commit e32c9b8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
51 changes: 0 additions & 51 deletions cinder/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ class InvalidGlobalAPIVersion(Invalid):
"is %(min_ver)s and maximum is %(max_ver)s.")


class MissingRequired(Invalid):
message = _("Missing required element '%(element)s' in request body.")


class ValidationError(Invalid):
message = "%(detail)s"

Expand Down Expand Up @@ -357,11 +353,6 @@ class VolumeMetadataNotFound(NotFound):
"key %(metadata_key)s.")


class VolumeAdminMetadataNotFound(NotFound):
message = _("Volume %(volume_id)s has no administration metadata with "
"key %(metadata_key)s.")


class InvalidVolumeMetadata(Invalid):
message = _("Invalid metadata: %(reason)s")

Expand Down Expand Up @@ -449,10 +440,6 @@ class SnapshotIsBusy(CinderException):
"dependent volumes")


class ISCSITargetNotFoundForVolume(NotFound):
message = _("No target id found for volume %(volume_id)s.")


class InvalidImageRef(Invalid):
message = _("Invalid image href %(image_href)s.")

Expand Down Expand Up @@ -563,10 +550,6 @@ class QuotaUsageNotFound(QuotaNotFound):
message = _("Quota usage for project %(project_id)s could not be found.")


class ReservationNotFound(QuotaNotFound):
message = _("Quota reservation %(uuid)s could not be found.")


class OverQuota(CinderException):
message = _("Quota exceeded for resources: %(overs)s")

Expand Down Expand Up @@ -606,14 +589,6 @@ class GroupVolumeTypeMappingExists(Duplicate):
"%(volume_type_id)s combination already exists.")


class GroupTypeEncryptionExists(Invalid):
message = _("Group type encryption for type %(type_id)s already exists.")


class GroupTypeEncryptionNotFound(NotFound):
message = _("Group type encryption for type %(type_id)s does not exist.")


class MalformedRequestBody(CinderException):
message = _("Malformed message body: %(reason)s")

Expand All @@ -630,11 +605,6 @@ class NoValidBackend(CinderException):
message = _("No valid backend was found. %(reason)s")


class NoMoreTargets(CinderException):
"""No more available targets."""
pass


class QuotaError(CinderException):
message = _("Quota exceeded: code=%(code)s")
code = 413
Expand Down Expand Up @@ -748,10 +718,6 @@ class RemoveExportException(VolumeDriverException):
message = _("Failed to remove export for volume %(volume)s: %(reason)s")


class MetadataCreateFailure(Invalid):
message = _("Failed to create metadata for volume: %(reason)s")


class MetadataUpdateFailure(Invalid):
message = _("Failed to update metadata for volume: %(reason)s")

Expand Down Expand Up @@ -802,10 +768,6 @@ class BackupNotFound(NotFound):
message = _("Backup %(backup_id)s could not be found.")


class BackupFailedToGetVolumeBackend(NotFound):
message = _("Failed to identify volume backend.")


class InvalidBackup(Invalid):
message = _("Invalid backup: %(reason)s")

Expand Down Expand Up @@ -899,11 +861,6 @@ class ReplicationGroupError(CinderException):
"error: %(reason)s.")


class ReplicationNotFound(NotFound):
message = _("Volume replication for %(volume_id)s "
"could not be found.")


class ManageExistingVolumeTypeMismatch(CinderException):
message = _("Manage existing volume failed due to volume type mismatch: "
"%(reason)s")
Expand All @@ -921,16 +878,8 @@ class LockCreationFailed(CinderException):
message = _('Unable to create lock. Coordination backend not started.')


class LockingFailed(CinderException):
message = _('Lock acquisition failed.')


UnsupportedObjectError = obj_exc.UnsupportedObjectError
OrphanedObjectError = obj_exc.OrphanedObjectError
IncompatibleObjectVersion = obj_exc.IncompatibleObjectVersion
ReadOnlyFieldError = obj_exc.ReadOnlyFieldError
ObjectActionError = obj_exc.ObjectActionError
ObjectFieldInvalid = obj_exc.ObjectFieldInvalid


class CappedVersionUnknown(CinderException):
Expand Down
1 change: 0 additions & 1 deletion cinder/volume/flows/manager/create_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def __init__(self, reschedule_context, db, driver, scheduler_rpcapi,
# they fail, rescheduling will likely attempt to create the volume
# on another machine when it still exists locally.
exception.MetadataCopyFailure,
exception.MetadataCreateFailure,
exception.MetadataUpdateFailure,
# The volume/snapshot has been removed from the database, that
# can not be fixed by rescheduling.
Expand Down

0 comments on commit e32c9b8

Please sign in to comment.