GPFS: Handle unsupported operations with an exception
This patch adds a support to fail the unsupported CG operations for GPFS driver with GPFSDriverUnsupportedOperation exception. Change-Id: Icd5a693ac75eca0f55cc3ecb014feb192e9e84d7 Closes-bug: #1691526
This commit is contained in:
parent
c7493f41dd
commit
77d17a1f8b
cinder
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user