Merge "GPFS: Handle unsupported operations with an exception"

This commit is contained in:
Jenkins 2017-05-24 11:38:47 +00:00 committed by Gerrit Code Review
commit e2077a99e8
3 changed files with 32 additions and 0 deletions

View File

@ -1389,3 +1389,8 @@ class ErrorInHyperScaleVersion(VolumeDriverException):
class ErrorInParsingArguments(VolumeDriverException):
message = _("Error in parsing message arguments : Invalid Payload")
# GPFS driver
class GPFSDriverUnsupportedOperation(VolumeBackendAPIException):
message = _("GPFS driver unsupported operation: %(msg)s")

View File

@ -1647,6 +1647,19 @@ class GPFSDriverTestCase(test.TestCase):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.delete_consistencygroup, ctxt, group, [])
def test_update_consistencygroup(self):
ctxt = self.context
group = self._fake_group()
self.assertRaises(exception.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.driver.create_consistencygroup_from_src,
ctxt, group, [])
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.create_snapshot')
def test_create_cgsnapshot(self, mock_create_snap):
ctxt = self.context

View File

@ -1240,6 +1240,20 @@ class GPFSDriver(driver.CloneableImageVD,
return model_update, snapshots_model_update
def update_consistencygroup(self, context, group,
add_volumes=None, remove_volumes=None):
msg = _('Updating a consistency group is not supported.')
LOG.error(msg)
raise exception.GPFSDriverUnsupportedOperation(msg=msg)
def create_consistencygroup_from_src(self, context, group, volumes,
cgsnapshot=None, snapshots=None,
source_cg=None, source_vols=None):
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)
@interface.volumedriver
class GPFSRemoteDriver(GPFSDriver, san.SanDriver):