From: KIYOHIRO ADACHI Date: Fri, 13 Sep 2013 02:57:39 +0000 (+0900) Subject: Remove unused exceptions X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=89ac0cb3e65f25374ca3af0f674e85cb2fbf9e1e;p=openstack-build%2Fcinder-build.git Remove unused exceptions Removed the exception classes in the following because not referenced anywhere. InvalidSourceVolume InvalidRequest PersistentVolumeFileNotFound InvalidSnapshotMetadata InvalidSnapshotMetadataSize DiskNotFound MigrationNotFoundByStatus ClassNotFound NotAllowed KeyPairExists MigrationError VolumeSizeExceedsQuota Duplicate3PARHost BackupVolumeInvalidType Change-Id: I7165f970752587885430f9d5c813b82b3f06ad70 --- diff --git a/cinder/exception.py b/cinder/exception.py index fb9d26648..77c0e192a 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -135,10 +135,6 @@ class InvalidSnapshot(Invalid): message = _("Invalid snapshot: %(reason)s") -class InvalidSourceVolume(Invalid): - message = _("Invalid source volume %(reason)s.") - - class InvalidVolumeAttachMode(Invalid): message = _("Invalid attaching mode '%(mode)s' for " "volume %(volume_id)s.") @@ -152,10 +148,6 @@ class SfJsonEncodeFailure(CinderException): message = _("Failed to load data into json format") -class InvalidRequest(Invalid): - message = _("The request is invalid.") - - class InvalidResults(Invalid): message = _("The results are invalid.") @@ -212,10 +204,6 @@ class NotFound(CinderException): safe = True -class PersistentVolumeFileNotFound(NotFound): - message = _("Volume %(volume_id)s persistence file could not be found.") - - class VolumeNotFound(NotFound): message = _("Volume %(volume_id)s could not be found.") @@ -252,14 +240,6 @@ class SnapshotMetadataNotFound(NotFound): "key %(metadata_key)s.") -class InvalidSnapshotMetadata(Invalid): - message = _("Invalid metadata: %(reason)s") - - -class InvalidSnapshotMetadataSize(Invalid): - message = _("Invalid metadata size: %(reason)s") - - class VolumeTypeNotFound(NotFound): message = _("Volume type %(volume_type_id)s could not be found.") @@ -296,10 +276,6 @@ class ISCSITargetNotFoundForVolume(NotFound): message = _("No target id found for volume %(volume_id)s.") -class DiskNotFound(NotFound): - message = _("No disk at %(location)s") - - class InvalidImageRef(Invalid): message = _("Invalid image href %(image_href)s.") @@ -369,32 +345,15 @@ class MigrationNotFound(NotFound): message = _("Migration %(migration_id)s could not be found.") -class MigrationNotFoundByStatus(MigrationNotFound): - message = _("Migration not found for instance %(instance_id)s " - "with status %(status)s.") - - class FileNotFound(NotFound): message = _("File %(file_path)s could not be found.") -class ClassNotFound(NotFound): - message = _("Class %(class_name)s could not be found: %(exception)s") - - -class NotAllowed(CinderException): - message = _("Action not allowed.") - - #TODO(bcwaldon): EOL this exception! class Duplicate(CinderException): pass -class KeyPairExists(Duplicate): - message = _("Key pair %(key_name)s already exists.") - - class VolumeTypeExists(Duplicate): message = _("Volume Type %(id)s already exists.") @@ -403,10 +362,6 @@ class VolumeTypeEncryptionExists(Invalid): message = _("Volume type encryption for type %(type_id)s already exists.") -class MigrationError(CinderException): - message = _("Migration error: %(reason)s") - - class MalformedRequestBody(CinderException): message = _("Malformed message body: %(reason)s") @@ -443,10 +398,6 @@ class VolumeSizeExceedsAvailableQuota(QuotaError): "allowed Gigabytes quota") -class VolumeSizeExceedsQuota(QuotaError): - message = _("Maximum volume/snapshot size exceeded") - - class VolumeLimitExceeded(QuotaError): message = _("Maximum number of volumes allowed (%(allowed)d) exceeded") @@ -459,10 +410,6 @@ class DuplicateSfVolumeNames(Duplicate): message = _("Detected more than one volume with name %(vol_name)s") -class Duplicate3PARHost(CinderException): - message = _("3PAR Host already exists: %(err)s. %(info)s") - - class Invalid3PARDomain(CinderException): message = _("Invalid 3PAR Domain: %(err)s") @@ -590,10 +537,6 @@ class BackupRBDOperationFailed(Invalid): message = _("Backup RBD operation failed") -class BackupVolumeInvalidType(Invalid): - message = _("Backup volume %(volume_id)s type not recognised.") - - class BackupNotFound(NotFound): message = _("Backup %(backup_id)s could not be found.")