Move RBD driver exception to driver

This patch moves the ceph driver's exception to it's driver file.

Change-Id: I054c5589a0b96849ad5ef745c1b3f30df26cfcc2
This commit is contained in:
Walter A. Boring IV 2019-05-17 23:03:16 +00:00
parent 33fa38b035
commit 17bf1d3875
2 changed files with 7 additions and 7 deletions

View File

@ -967,11 +967,6 @@ class PureRetryableException(VolumeBackendAPIException):
message = _("Retryable Pure Storage Exception encountered")
# RBD
class RBDDriverException(VolumeDriverException):
message = _("RBD Cinder driver failure: %(reason)s")
# RemoteFS drivers
class RemoteFSException(VolumeDriverException):
message = _("Unknown RemoteFS exception")

View File

@ -134,6 +134,11 @@ EXTRA_SPECS_REPL_ENABLED = "replication_enabled"
EXTRA_SPECS_MULTIATTACH = "multiattach"
# RBD
class RBDDriverException(exception.VolumeDriverException):
message = _("RBD Cinder driver failure: %(reason)s")
class RBDVolumeProxy(object):
"""Context manager for dealing with an existing rbd volume.
@ -788,7 +793,7 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
if want_replication and want_multiattach:
msg = _('Replication and Multiattach are mutually exclusive.')
raise exception.RBDDriverException(reason=msg)
raise RBDDriverException(reason=msg)
if want_replication:
return self._enable_replication(volume)
@ -1201,7 +1206,7 @@ class RBDDriver(driver.CloneableImageVD, driver.MigrateVD,
# feautures to restore.
if self._is_multiattach_type(volume.volume_type):
msg = _('Retyping from multiattach is not supported.')
raise exception.RBDDriverException(reason=msg)
raise RBDDriverException(reason=msg)
old_vol_replicated = self._is_replicated_type(volume.volume_type)
new_vol_replicated = self._is_replicated_type(new_type)