diff --git a/cinder/exception.py b/cinder/exception.py index 717296976f5..9064b3ccf28 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -1359,3 +1359,8 @@ class AttachmentSpecsNotFound(NotFound): class InvalidAttachment(Invalid): message = _("Invalid attachment: %(reason)s") + + +# GPFS driver +class GPFSDriverUnsupportedOperation(VolumeBackendAPIException): + message = _("GPFS driver unsupported operation: %(msg)s") diff --git a/cinder/tests/unit/volume/drivers/test_gpfs.py b/cinder/tests/unit/volume/drivers/test_gpfs.py index 283c9e184e1..81c6592c220 100644 --- a/cinder/tests/unit/volume/drivers/test_gpfs.py +++ b/cinder/tests/unit/volume/drivers/test_gpfs.py @@ -1686,6 +1686,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 diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index 8eba375c4ad..d77a5fab09a 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/cinder/volume/drivers/ibm/gpfs.py @@ -1235,6 +1235,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 GPFSNFSDriver(GPFSDriver, nfs.NfsDriver, san.SanDriver):