move GPFS driver exception to driver file
This patch moves the GPFS specific driver exception to the driver file itself. Change-Id: I25e4a9abb351b208b4efac1b0fa5b77101f74ff6
This commit is contained in:
parent
6fcb7c6639
commit
e049afa652
|
@ -1367,11 +1367,6 @@ class ErrorInHyperScaleVersion(VolumeDriverException):
|
||||||
message = _("Error in getting HyperScale version '%(cmd_error)s'")
|
message = _("Error in getting HyperScale version '%(cmd_error)s'")
|
||||||
|
|
||||||
|
|
||||||
# GPFS driver
|
|
||||||
class GPFSDriverUnsupportedOperation(VolumeBackendAPIException):
|
|
||||||
message = _("GPFS driver unsupported operation: %(msg)s")
|
|
||||||
|
|
||||||
|
|
||||||
class InvalidName(Invalid):
|
class InvalidName(Invalid):
|
||||||
message = _("An invalid 'name' value was provided. %(reason)s")
|
message = _("An invalid 'name' value was provided. %(reason)s")
|
||||||
|
|
||||||
|
|
|
@ -1668,13 +1668,13 @@ class GPFSDriverTestCase(test.TestCase):
|
||||||
def test_update_consistencygroup(self):
|
def test_update_consistencygroup(self):
|
||||||
ctxt = self.context
|
ctxt = self.context
|
||||||
group = self._fake_group()
|
group = self._fake_group()
|
||||||
self.assertRaises(exception.GPFSDriverUnsupportedOperation,
|
self.assertRaises(gpfs.GPFSDriverUnsupportedOperation,
|
||||||
self.driver._update_consistencygroup, ctxt, group)
|
self.driver._update_consistencygroup, ctxt, group)
|
||||||
|
|
||||||
def test_create_consisgroup_from_src(self):
|
def test_create_consisgroup_from_src(self):
|
||||||
ctxt = self.context
|
ctxt = self.context
|
||||||
group = self._fake_group()
|
group = self._fake_group()
|
||||||
self.assertRaises(exception.GPFSDriverUnsupportedOperation,
|
self.assertRaises(gpfs.GPFSDriverUnsupportedOperation,
|
||||||
self.driver._create_consistencygroup_from_src,
|
self.driver._create_consistencygroup_from_src,
|
||||||
ctxt, group, [])
|
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)
|
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):
|
def _different(difference_tuple):
|
||||||
"""Return true if two elements of a tuple are different."""
|
"""Return true if two elements of a tuple are different."""
|
||||||
if difference_tuple:
|
if difference_tuple:
|
||||||
|
@ -1268,7 +1272,7 @@ class GPFSDriver(driver.CloneableImageVD,
|
||||||
add_volumes=None, remove_volumes=None):
|
add_volumes=None, remove_volumes=None):
|
||||||
msg = _('Updating a consistency group is not supported.')
|
msg = _('Updating a consistency group is not supported.')
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.GPFSDriverUnsupportedOperation(msg=msg)
|
raise GPFSDriverUnsupportedOperation(msg=msg)
|
||||||
|
|
||||||
def _create_consistencygroup_from_src(self, context, group, volumes,
|
def _create_consistencygroup_from_src(self, context, group, volumes,
|
||||||
cgsnapshot=None, snapshots=None,
|
cgsnapshot=None, snapshots=None,
|
||||||
|
@ -1276,7 +1280,7 @@ class GPFSDriver(driver.CloneableImageVD,
|
||||||
msg = _('Creating a consistency group from any source consistency '
|
msg = _('Creating a consistency group from any source consistency '
|
||||||
'group or consistency group snapshot is not supported.')
|
'group or consistency group snapshot is not supported.')
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.GPFSDriverUnsupportedOperation(msg=msg)
|
raise GPFSDriverUnsupportedOperation(msg=msg)
|
||||||
|
|
||||||
def create_group(self, ctxt, group):
|
def create_group(self, ctxt, group):
|
||||||
"""Creates a group.
|
"""Creates a group.
|
||||||
|
|
Loading…
Reference in New Issue