From: John Griffith Date: Fri, 19 Feb 2016 21:16:54 +0000 (-0700) Subject: Remove useless get_replication_updates driver call X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=2ed92b09d53efb252afef59c4f453b4f836d5968;p=openstack-build%2Fcinder-build.git Remove useless get_replication_updates driver call We had the call in the manager as part of a periodic, it did nothing at all. Some drivers had comments "no idea what to do with this", even better we had unit tests that faked out a call that returned nothing and asserted it was nothing. ?!? Let's just remove it Change-Id: I3c1ef6065e73d90912d7f765d581add9bc704c7b Closes-Bug: #1547666 --- diff --git a/cinder/tests/unit/fake_driver.py b/cinder/tests/unit/fake_driver.py index 9137cf048..b641784b4 100644 --- a/cinder/tests/unit/fake_driver.py +++ b/cinder/tests/unit/fake_driver.py @@ -340,6 +340,3 @@ class FakeGateDriver(lvm.LVMVolumeDriver): targets.append(remote_target) return {'volume_id': volume['id'], 'targets': targets} - - def get_replication_updates(self, context): - return [] diff --git a/cinder/tests/unit/test_dellsc.py b/cinder/tests/unit/test_dellsc.py index d636bdad0..d726d59e4 100644 --- a/cinder/tests/unit/test_dellsc.py +++ b/cinder/tests/unit/test_dellsc.py @@ -2529,10 +2529,3 @@ class DellSCSanISCSIDriverTestCase(test.TestCase): self.assertEqual(expected, ret) self.driver.backends = backends - - def test_get_replication_updates(self, - mock_close_connection, - mock_open_connection, - mock_init): - ret = self.driver.get_replication_updates({}) - self.assertEqual([], ret) diff --git a/cinder/tests/unit/test_ibm_xiv_ds8k.py b/cinder/tests/unit/test_ibm_xiv_ds8k.py index df73e6207..0a3fb8b69 100644 --- a/cinder/tests/unit/test_ibm_xiv_ds8k.py +++ b/cinder/tests/unit/test_ibm_xiv_ds8k.py @@ -284,10 +284,6 @@ class XIVDS8KFakeProxyDriver(object): return {'status': 'deleted'}, updated_snapshots - def get_replication_updates(self, context): - - return [] - def replication_disable(self, context, volume): if volume['replication_status'] == 'invalid_status_val': raise exception.CinderException() @@ -989,14 +985,6 @@ class XIVDS8KVolumeDriverTest(test.TestCase): volumes_model_update['status'], "volumes list status failed") - def test_get_replication_updates(self): - """Get replication updates.""" - - self.driver.do_setup(None) - - ret = self.driver.get_replication_updates(CONTEXT) - self.assertEqual([], ret) - def test_replication_disable(self): """Disable replication on the specified volume.""" diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 286943d51..4c7ba2b26 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -1975,22 +1975,6 @@ class ReplicaV2VD(object): raise NotImplementedError() - @abc.abstractmethod - def get_replication_updates(self, context): - """Provide a means to obtain status updates from backend. - - Provides a concise update for backends to report any errors - or problems with replicating volumes. The intent is we only - return something here if there's an error or a problem, and to - notify where the backend thinks the volume is. - - param: context: context of caller (probably don't need) - returns: [{volid: n, status: ok|error,...}] - """ - # NOTE(jdg): flush this out with implementations so we all - # have something usable here - raise NotImplementedError() - @six.add_metaclass(abc.ABCMeta) class ManageableSnapshotsVD(object): diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index 888811930..ed111eb6a 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -1208,7 +1208,3 @@ class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD, replication_targets = {'volume_id': vref.get('id'), 'targets': targets} LOG.info(_LI('list_replication_targets: %s'), replication_targets) return replication_targets - - def get_replication_updates(self, context): - # No idea what to do with this. - return [] diff --git a/cinder/volume/drivers/emc/emc_cli_fc.py b/cinder/volume/drivers/emc/emc_cli_fc.py index a00db8639..b2a602522 100644 --- a/cinder/volume/drivers/emc/emc_cli_fc.py +++ b/cinder/volume/drivers/emc/emc_cli_fc.py @@ -313,10 +313,6 @@ class EMCCLIFCDriver(driver.FibreChannelDriver): """Failovers volume from primary device to secondary.""" return self.cli.replication_failover(context, volume, secondary) - def get_replication_updates(self, context): - """Returns updated replication status from volumes.""" - return self.cli.get_replication_updates(context) - def list_replication_targets(self, context, volume): """Returns volume replication info.""" return self.cli.list_replication_targets(context, volume) diff --git a/cinder/volume/drivers/emc/emc_cli_iscsi.py b/cinder/volume/drivers/emc/emc_cli_iscsi.py index 1d7821f33..eb33b940b 100644 --- a/cinder/volume/drivers/emc/emc_cli_iscsi.py +++ b/cinder/volume/drivers/emc/emc_cli_iscsi.py @@ -292,10 +292,6 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver): """Failovers volume from primary device to secondary.""" return self.cli.replication_failover(context, volume, secondary) - def get_replication_updates(self, context): - """Returns updated replication status from volumes.""" - return self.cli.get_replication_updates(context) - def list_replication_targets(self, context, volume): """Returns volume replication info.""" return self.cli.list_replication_targets(context, volume) diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 646907f5a..592f7ba76 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -4009,10 +4009,6 @@ class EMCVnxCliBase(object): 'provider_location': provider_location} return model_update - def get_replication_updates(self, context): - """Return nothing since Cinder doesn't do anything.""" - return [] - def list_replication_targets(self, context, volume): """Provides replication target(s) for a volume.""" targets = {'volume_id': volume.id, 'targets': []} diff --git a/cinder/volume/drivers/hpe/hpe_3par_common.py b/cinder/volume/drivers/hpe/hpe_3par_common.py index 4d0d060cf..794897fcc 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_common.py +++ b/cinder/volume/drivers/hpe/hpe_3par_common.py @@ -2849,12 +2849,6 @@ class HPE3PARCommon(object): return existing_vluns # v2 replication methods - def get_replication_updates(self, context): - # TODO(aorourke): the manager does not do anything with these updates. - # When that is chanaged, I will modify this as well. - errors = [] - return errors - def replication_enable(self, context, volume): """Enable replication on a replication capable volume.""" if not self._volume_of_replicated_type(volume): diff --git a/cinder/volume/drivers/hpe/hpe_3par_fc.py b/cinder/volume/drivers/hpe/hpe_3par_fc.py index 42a422c5d..8d7017f6a 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_fc.py +++ b/cinder/volume/drivers/hpe/hpe_3par_fc.py @@ -609,13 +609,6 @@ class HPE3PARFCDriver(driver.TransferVD, finally: self._logout(common) - def get_replication_updates(self, context): - common = self._login() - try: - return common.get_replication_updates(context) - finally: - self._logout(common) - def replication_enable(self, context, volume): """Enable replication on a replication capable volume.""" common = self._login(volume) diff --git a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py index e9e487c42..562829cad 100644 --- a/cinder/volume/drivers/hpe/hpe_3par_iscsi.py +++ b/cinder/volume/drivers/hpe/hpe_3par_iscsi.py @@ -920,13 +920,6 @@ class HPE3PARISCSIDriver(driver.TransferVD, finally: self._logout(common) - def get_replication_updates(self, context): - common = self._login() - try: - return common.get_replication_updates(context) - finally: - self._logout(common) - def replication_enable(self, context, volume): """Enable replication on a replication capable volume.""" common = self._login(volume) diff --git a/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py b/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py index 3523ccb1e..6605deec6 100644 --- a/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py +++ b/cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py @@ -1399,12 +1399,6 @@ class HPELeftHandISCSIDriver(driver.ISCSIDriver): return volume_types.get_volume_type(ctxt, type_id) # v2 replication methods - def get_replication_updates(self, context): - # TODO(aorourke): the manager does not do anything with these updates. - # When that is changed, I will modify this as well. - errors = [] - return errors - def replication_enable(self, context, volume): """Enable replication on a replication capable volume.""" model_update = {} diff --git a/cinder/volume/drivers/huawei/huawei_driver.py b/cinder/volume/drivers/huawei/huawei_driver.py index 06eca13d7..80e02b600 100644 --- a/cinder/volume/drivers/huawei/huawei_driver.py +++ b/cinder/volume/drivers/huawei/huawei_driver.py @@ -1401,11 +1401,6 @@ class HuaweiBaseDriver(driver.VolumeDriver): """Obtain volume repliction targets.""" return self.replica.list_replica_targets(vref) - def get_replication_updates(self, context): - # NOTE(jlc): The manager does not do aynthing with these updates. - # When that is changed, here must be modified as well. - return [] - class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver): """ISCSI driver for Huawei storage arrays. diff --git a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py index c925a2c08..98fc51e82 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py +++ b/cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py @@ -2434,11 +2434,6 @@ class StorwizeSVCCommonDriver(san.SanDriver, return storwize_rep.StorwizeSVCReplicationMetroMirror( self, rep_target, StorwizeHelpers) - def get_replication_updates(self, context): - # TODO(vhou): the manager does not need to do anything so far. - replication_updates = [] - return replication_updates - def migrate_volume(self, ctxt, volume, host): """Migrate directly if source and dest are managed by same storage. diff --git a/cinder/volume/drivers/ibm/xiv_ds8k.py b/cinder/volume/drivers/ibm/xiv_ds8k.py index daa04601f..429ab5244 100644 --- a/cinder/volume/drivers/ibm/xiv_ds8k.py +++ b/cinder/volume/drivers/ibm/xiv_ds8k.py @@ -281,11 +281,6 @@ class XIVDS8KDriver(san.SanDriver, context, group, volumes, cgsnapshot, snapshots, source_cg, source_vols) - def get_replication_updates(self, context): - """Get replication updates.""" - - return self.xiv_ds8k_proxy.get_replication_updates(context) - def replication_disable(self, context, volume): """Disable replication on the specified volume.""" diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index 4867a2c83..951083d78 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -1203,11 +1203,6 @@ class PureBaseVolumeDriver(san.SanDriver): data["targets"] = remote_targets return data - def get_replication_updates(self, context): - # currently, the manager does not use these updates. - # TODO(mudassir): update this when implemented in manager - return [] - def _get_current_array(self, volume): current_array, _ = self._get_arrays(volume) return current_array diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index cf680b7e6..91c903161 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -1928,25 +1928,6 @@ class VolumeManager(manager.SchedulerDependentManager): # queue it to be sent to the Schedulers. self.update_service_capabilities(volume_stats) - if volume_stats.get('replication_enabled', False): - # replciation_status provides a concise update of - # replicating volumes and any error conditions - # detected by the driver. The intent is we don't - # expect/worry about updates so long as nothing - # changes, but if something goes wrong this is a - # handy mechanism to update the manager and the db - # possibly let the admin/user be notified - - # TODO(jdg): Refactor the check/update pieces to a - # helper method we can share - # We want to leverage some of the same update model - # that we have in the targets update call - - replication_updates = ( - self.driver.get_replication_updates(context)) - for update in replication_updates: - pass - def _append_volume_stats(self, vol_stats): pools = vol_stats.get('pools', None) if pools and isinstance(pools, list):