Merge "move GPFS driver exception to driver file"
This commit is contained in:
@@ -1350,11 +1350,6 @@ class ErrorInHyperScaleVersion(VolumeDriverException):
|
||||
message = _("Error in getting HyperScale version '%(cmd_error)s'")
|
||||
|
||||
|
||||
# GPFS driver
|
||||
class GPFSDriverUnsupportedOperation(VolumeBackendAPIException):
|
||||
message = _("GPFS driver unsupported operation: %(msg)s")
|
||||
|
||||
|
||||
class InvalidName(Invalid):
|
||||
message = _("An invalid 'name' value was provided. %(reason)s")
|
||||
|
||||
|
||||
@@ -1668,13 +1668,13 @@ class GPFSDriverTestCase(test.TestCase):
|
||||
def test_update_consistencygroup(self):
|
||||
ctxt = self.context
|
||||
group = self._fake_group()
|
||||
self.assertRaises(exception.GPFSDriverUnsupportedOperation,
|
||||
self.assertRaises(gpfs.GPFSDriverUnsupportedOperation,
|
||||
self.driver._update_consistencygroup, ctxt, group)
|
||||
|
||||
def test_create_consisgroup_from_src(self):
|
||||
ctxt = self.context
|
||||
group = self._fake_group()
|
||||
self.assertRaises(exception.GPFSDriverUnsupportedOperation,
|
||||
self.assertRaises(gpfs.GPFSDriverUnsupportedOperation,
|
||||
self.driver._create_consistencygroup_from_src,
|
||||
ctxt, group, [])
|
||||
|
||||
|
||||
@@ -121,6 +121,10 @@ CONF.register_opts(gpfs_opts, group=configuration.SHARED_CONF_GROUP)
|
||||
CONF.register_opts(gpfs_remote_ssh_opts, group=configuration.SHARED_CONF_GROUP)
|
||||
|
||||
|
||||
class GPFSDriverUnsupportedOperation(exception.VolumeBackendAPIException):
|
||||
message = _("GPFS driver unsupported operation: %(msg)s")
|
||||
|
||||
|
||||
def _different(difference_tuple):
|
||||
"""Return true if two elements of a tuple are different."""
|
||||
if difference_tuple:
|
||||
@@ -1268,7 +1272,7 @@ class GPFSDriver(driver.CloneableImageVD,
|
||||
add_volumes=None, remove_volumes=None):
|
||||
msg = _('Updating a consistency group is not supported.')
|
||||
LOG.error(msg)
|
||||
raise exception.GPFSDriverUnsupportedOperation(msg=msg)
|
||||
raise GPFSDriverUnsupportedOperation(msg=msg)
|
||||
|
||||
def _create_consistencygroup_from_src(self, context, group, volumes,
|
||||
cgsnapshot=None, snapshots=None,
|
||||
@@ -1276,7 +1280,7 @@ class GPFSDriver(driver.CloneableImageVD,
|
||||
msg = _('Creating a consistency group from any source consistency '
|
||||
'group or consistency group snapshot is not supported.')
|
||||
LOG.error(msg)
|
||||
raise exception.GPFSDriverUnsupportedOperation(msg=msg)
|
||||
raise GPFSDriverUnsupportedOperation(msg=msg)
|
||||
|
||||
def create_group(self, ctxt, group):
|
||||
"""Creates a group.
|
||||
|
||||
Reference in New Issue
Block a user