return unicode(self.msg)
+class VolumeBackendAPIException(CinderException):
+ message = _("Bad or unexpected response from the storage volume "
+ "backend API: %(data)s")
+
+
+class VolumeDriverException(CinderException):
+ message = _("Volume driver reported an error: %(message)s")
+
+
+class BackupDriverException(CinderException):
+ message = _("Backup driver reported an error: %(message)s")
+
+
class GlanceConnectionFailed(CinderException):
message = _("Connection to glance failed: %(reason)s")
message = _("Volume %(volume_id)s could not be found.")
-class SfAccountNotFound(NotFound):
- message = _("Unable to locate account %(account_name)s on "
- "Solidfire device")
-
-
class VolumeMetadataNotFound(NotFound):
message = _("Volume %(volume_id)s has no metadata with "
"key %(metadata_key)s.")
message = _("Detected more than one volume with name %(vol_name)s")
-class Invalid3PARDomain(CinderException):
- message = _("Invalid 3PAR Domain: %(err)s")
-
-
class VolumeTypeCreateFailed(CinderException):
message = _("Cannot create volume_type with "
"name %(name)s and specs %(extra_specs)s")
-class SolidFireAPIException(CinderException):
- message = _("Bad response from SolidFire API")
-
-
-class SolidFireAPIDataException(SolidFireAPIException):
- message = _("Error in SolidFire API response: data=%(data)s")
-
-
-class UnknownCmd(Invalid):
+class UnknownCmd(VolumeDriverException):
message = _("Unknown or unsupported command %(cmd)s")
-class MalformedResponse(Invalid):
+class MalformedResponse(VolumeDriverException):
message = _("Malformed response to command %(cmd)s: %(reason)s")
-class BadHTTPResponseStatus(CinderException):
- message = _("Bad HTTP response status %(status)s")
+class BadDriverResponseStatus(VolumeDriverException):
+ message = _("Bad driver response status: %(status)s")
-class FailedCmdWithDump(CinderException):
+class FailedCmdWithDump(VolumeDriverException):
message = _("Operation failed with status=%(status)s. Full dump: %(data)s")
-class ZadaraServerCreateFailure(CinderException):
- message = _("Unable to create server object for initiator %(name)s")
-
-
-class ZadaraServerNotFound(NotFound):
- message = _("Unable to find server object for initiator %(name)s")
-
-
-class ZadaraVPSANoActiveController(CinderException):
- message = _("Unable to find any active VPSA controller")
-
-
-class ZadaraAttachmentsNotFound(NotFound):
- message = _("Failed to retrieve attachments for volume %(name)s")
-
-
-class ZadaraInvalidAttachmentInfo(Invalid):
- message = _("Invalid attachment info for volume %(name)s: %(reason)s")
-
-
class InstanceNotFound(NotFound):
message = _("Instance %(instance_id)s could not be found.")
-class VolumeBackendAPIException(CinderException):
- message = _("Bad or unexpected response from the storage volume "
- "backend API: %(data)s")
-
-
-class NfsException(CinderException):
- message = _("Unknown NFS exception")
-
-
-class NfsNoSharesMounted(NotFound):
- message = _("No mounted NFS shares found")
-
-
-class NfsNoSuitableShareFound(NotFound):
- message = _("There is no share which can host %(volume_size)sG")
-
-
-class GlusterfsException(CinderException):
- message = _("Unknown Gluster exception")
-
-
-class GlusterfsNoSharesMounted(NotFound):
- message = _("No mounted Gluster shares found")
-
-
-class GlusterfsNoSuitableShareFound(NotFound):
- message = _("There is no share which can host %(volume_size)sG")
-
-
class GlanceMetadataExists(Invalid):
message = _("Glance metadata cannot be updated, key %(key)s"
" exists for volume id %(volume_id)s")
message = _("Failed to copy image to volume: %(reason)s")
-class BackupInvalidCephArgs(Invalid):
+class BackupInvalidCephArgs(BackupDriverException):
message = _("Invalid Ceph args provided for backup rbd operation")
message = _("An error has occurred during backup operation")
-class BackupRBDOperationFailed(Invalid):
+class BackupRBDOperationFailed(BackupDriverException):
message = _("Backup RBD operation failed")
message = _("Invalid backup: %(reason)s")
-class SwiftConnectionFailed(CinderException):
+class SwiftConnectionFailed(BackupDriverException):
message = _("Connection to swift failed: %(reason)s")
message = _("SSH command injection detected: %(command)s")
-class CoraidException(CinderException):
+class QoSSpecsExists(Duplicate):
+ message = _("QoS Specs %(specs_id)s already exists.")
+
+
+class QoSSpecsCreateFailed(CinderException):
+ message = _("Failed to create qos_specs: "
+ "%(name)s with specs %(qos_specs)s.")
+
+
+class QoSSpecsUpdateFailed(CinderException):
+ message = _("Failed to update qos_specs: "
+ "%(specs_id)s with specs %(qos_specs)s.")
+
+
+class QoSSpecsNotFound(NotFound):
+ message = _("No such QoS spec %(specs_id)s.")
+
+
+class QoSSpecsAssociateFailed(CinderException):
+ message = _("Failed to associate qos_specs: "
+ "%(specs_id)s with type %(type_id)s.")
+
+
+class QoSSpecsDisassociateFailed(CinderException):
+ message = _("Failed to disassociate qos_specs: "
+ "%(specs_id)s with type %(type_id)s.")
+
+
+class QoSSpecsKeyNotFound(NotFound):
+ message = _("QoS spec %(specs_id)s has no spec with "
+ "key %(specs_key)s.")
+
+
+class InvalidQoSSpecs(Invalid):
+ message = _("Invalid qos specs: %(reason)s")
+
+
+class QoSSpecsInUse(CinderException):
+ message = _("QoS Specs %(specs_id)s is still associated with entities.")
+
+
+class KeyManagerError(CinderException):
+ msg_fmt = _("key manager error: %(reason)s")
+
+
+# Driver specific exceptions
+# Coraid
+class CoraidException(VolumeDriverException):
message = _('Coraid Cinder Driver exception.')
message = _('Coraid ESM not available with reason: %(reason)s.')
-class QoSSpecsExists(Duplicate):
- message = _("QoS Specs %(specs_id)s already exists.")
+# Zadara
+class ZadaraException(VolumeDriverException):
+ message = _('Zadara Cinder Driver exception.')
-class QoSSpecsCreateFailed(CinderException):
- message = _("Failed to create qos_specs: "
- "%(name)s with specs %(qos_specs)s.")
+class ZadaraServerCreateFailure(ZadaraException):
+ message = _("Unable to create server object for initiator %(name)s")
-class QoSSpecsUpdateFailed(CinderException):
- message = _("Failed to update qos_specs: "
- "%(specs_id)s with specs %(qos_specs)s.")
+class ZadaraServerNotFound(ZadaraException):
+ message = _("Unable to find server object for initiator %(name)s")
-class QoSSpecsNotFound(NotFound):
- message = _("No such QoS spec %(specs_id)s.")
+class ZadaraVPSANoActiveController(ZadaraException):
+ message = _("Unable to find any active VPSA controller")
-class QoSSpecsAssociateFailed(CinderException):
- message = _("Failed to associate qos_specs: "
- "%(specs_id)s with type %(type_id)s.")
+class ZadaraAttachmentsNotFound(ZadaraException):
+ message = _("Failed to retrieve attachments for volume %(name)s")
-class QoSSpecsDisassociateFailed(CinderException):
- message = _("Failed to disassociate qos_specs: "
- "%(specs_id)s with type %(type_id)s.")
+class ZadaraInvalidAttachmentInfo(ZadaraException):
+ message = _("Invalid attachment info for volume %(name)s: %(reason)s")
-class QoSSpecsKeyNotFound(NotFound):
- message = _("QoS spec %(specs_id)s has no spec with "
- "key %(specs_key)s.")
+class BadHTTPResponseStatus(ZadaraException):
+ message = _("Bad HTTP response status %(status)s")
-class InvalidQoSSpecs(Invalid):
- message = _("Invalid qos specs: %(reason)s")
+#SolidFire
+class SolidFireAPIException(VolumeBackendAPIException):
+ message = _("Bad response from SolidFire API")
-class QoSSpecsInUse(CinderException):
- message = _("QoS Specs %(specs_id)s is still associated with entities.")
+class SolidFireDriverException(VolumeDriverException):
+ message = _("SolidFire Cinder Driver exception")
-class KeyManagerError(CinderException):
- msg_fmt = _("key manager error: %(reason)s")
+class SolidFireAPIDataException(SolidFireAPIException):
+ message = _("Error in SolidFire API response: data=%(data)s")
+
+
+class SolidFireAccountNotFound(SolidFireDriverException):
+ message = _("Unable to locate account %(account_name)s on "
+ "Solidfire device")
+
+
+class DuplicateSolidFireVolumeNames(SolidFireDriverException):
+ message = _("Detected more than one volume with name %(vol_name)s")
+
+
+# HP 3Par
+class Invalid3PARDomain(VolumeDriverException):
+ message = _("Invalid 3PAR Domain: %(err)s")
+
+
+# NFS driver
+class NfsException(VolumeDriverException):
+ message = _("Unknown NFS exception")
+
+
+class NfsNoSharesMounted(VolumeDriverException):
+ message = _("No mounted NFS shares found")
+
+
+class NfsNoSuitableShareFound(VolumeDriverException):
+ message = _("There is no share which can host %(volume_size)sG")
+
+
+# Gluster driver
+class GlusterfsException(VolumeDriverException):
+ message = _("Unknown Gluster exception")
+
+
+class GlusterfsNoSharesMounted(VolumeDriverException):
+ message = _("No mounted Gluster shares found")
+
+
+class GlusterfsNoSuitableShareFound(VolumeDriverException):
+ message = _("There is no share which can host %(volume_size)sG")