]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove useless get_replication_updates driver call
authorJohn Griffith <john.griffith8@gmail.com>
Fri, 19 Feb 2016 21:16:54 +0000 (14:16 -0700)
committerJohn Griffith <john.griffith8@gmail.com>
Fri, 19 Feb 2016 21:22:43 +0000 (14:22 -0700)
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

17 files changed:
cinder/tests/unit/fake_driver.py
cinder/tests/unit/test_dellsc.py
cinder/tests/unit/test_ibm_xiv_ds8k.py
cinder/volume/driver.py
cinder/volume/drivers/dell/dell_storagecenter_common.py
cinder/volume/drivers/emc/emc_cli_fc.py
cinder/volume/drivers/emc/emc_cli_iscsi.py
cinder/volume/drivers/emc/emc_vnx_cli.py
cinder/volume/drivers/hpe/hpe_3par_common.py
cinder/volume/drivers/hpe/hpe_3par_fc.py
cinder/volume/drivers/hpe/hpe_3par_iscsi.py
cinder/volume/drivers/hpe/hpe_lefthand_iscsi.py
cinder/volume/drivers/huawei/huawei_driver.py
cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py
cinder/volume/drivers/ibm/xiv_ds8k.py
cinder/volume/drivers/pure.py
cinder/volume/manager.py

index 9137cf048cc58fb76d5a50a57705e3509c48e2eb..b641784b477cd140f8c738b7de639b193f04aebe 100644 (file)
@@ -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 []
index d636bdad0f3c846b8faa80a0e61c2a23ed48e410..d726d59e461fb7a5f352a2bdc0d1889c3bbadb45 100644 (file)
@@ -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)
index df73e620779bb0c6d3c2296baea9852f394b743a..0a3fb8b6943f94d0b7f13c70f6851d9a447e4d81 100644 (file)
@@ -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."""
 
index 286943d51292632fba31ab9ed450df5b3a0dbfae..4c7ba2b2628e8c909301a5b73f3ae1d2231e0a8f 100644 (file)
@@ -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):
index 8888119302d45baddcbc6e5bdf446abd7c26e1a4..ed111eb6a87b46275ec81eacc1f8c3239f961151 100644 (file)
@@ -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 []
index a00db8639f9fa0595db57e92fdd92e30f699d718..b2a6025225c6037a240d3950decd4af16c7efca4 100644 (file)
@@ -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)
index 1d7821f332509ad1d871fb97e17555f9d908ed48..eb33b940b42b06d3d4d1f7d8245be996a0f448fe 100644 (file)
@@ -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)
index 646907f5a6d0377e5d47aec3a815cd1021ada143..592f7ba76e3d2da7fcda263df5d2839bbbd1b181 100644 (file)
@@ -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': []}
index 4d0d060cf2404bb4138b2206cbc63c585b41fb76..794897fcccf7855f5832fa63c330fc838ee5e748 100644 (file)
@@ -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):
index 42a422c5d9f8aa43775083e640e2fd379be452d4..8d7017f6aaa71adef4e55802c0e18abe05401d49 100644 (file)
@@ -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)
index e9e487c42c26119a44d15b6341aaa3a32e6bc4fa..562829cadea2983c6b92cda050b46e34f1f41c66 100644 (file)
@@ -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)
index 3523ccb1e1d50094e7575b0e877275b0c413d242..6605deec6c76b6043cbae79512ca38dbf4569367 100644 (file)
@@ -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 = {}
index 06eca13d79a83f0b55d09d0d83c3b025905aae03..80e02b6008947149dd45ef2de5b9e48685eeaebd 100644 (file)
@@ -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.
index c925a2c0825a63efd3fd76d86760fba9236c90ff..98fc51e828bf1bd43889cf674a9d46edf2913269 100644 (file)
@@ -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.
 
index daa04601f94daf4d810e69c5278b5eda0aa089eb..429ab5244a37687134c1f794aa22a8cc584080a2 100644 (file)
@@ -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."""
 
index 4867a2c836d45f9ef1855791a2f3617d902ea9c9..951083d78b66e557d8525987c75d0d520f985aa2 100644 (file)
@@ -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
index cf680b7e6282d9bf1827021c341dd604feee1b20..91c903161b91d27ec7061ac61d50ac78984916a1 100644 (file)
@@ -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):