From eda73c3b27159de97df132b53264cd8a620b4b95 Mon Sep 17 00:00:00 2001 From: Dongsheng Yang Date: Sat, 12 Mar 2016 01:03:30 -0500 Subject: [PATCH] Cleanup for Replication v2: remove 'replication-reenable'. As Replication v2.1 (Cheesecake) was merged in cinder, let's remove the some remaining replication related code in cinderclient. Depends-on: If862bcd18515098639f94a8294a8e44e1358c52a Change-Id: I91964cc77dbb97f84e1045da16b4ceabc14b0b6d --- cinderclient/tests/unit/v2/fakes.py | 5 ----- cinderclient/tests/unit/v2/test_shell.py | 5 ----- cinderclient/tests/unit/v2/test_volumes.py | 8 -------- cinderclient/v2/shell.py | 10 ---------- cinderclient/v2/volumes.py | 4 ---- 5 files changed, 32 deletions(-) diff --git a/cinderclient/tests/unit/v2/fakes.py b/cinderclient/tests/unit/v2/fakes.py index b02a6fcae..5233e9a47 100644 --- a/cinderclient/tests/unit/v2/fakes.py +++ b/cinderclient/tests/unit/v2/fakes.py @@ -455,8 +455,6 @@ class FakeHTTPClient(base_client.HTTPClient): assert list(body[action]) == ['bootable'] elif action == 'os-unmanage': assert body[action] is None - elif action == 'os-reenable-replica': - assert body[action] is None elif action == 'os-set_image_metadata': assert list(body[action]) == ['metadata'] elif action == 'os-unset_image_metadata': @@ -1085,9 +1083,6 @@ class FakeHTTPClient(base_client.HTTPClient): snapshot.update(kw['body']['snapshot']) return (202, {}, {'snapshot': snapshot}) - def post_os_reenable_replica_1234(self, **kw): - return (202, {}, {}) - def get_scheduler_stats_get_pools(self, **kw): stats = [ { diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py index 453d8493b..955b8486c 100644 --- a/cinderclient/tests/unit/v2/test_shell.py +++ b/cinderclient/tests/unit/v2/test_shell.py @@ -1029,11 +1029,6 @@ class ShellTest(utils.TestCase): self.assert_called('POST', '/volumes/1234/action', body={'os-unmanage': None}) - def test_replication_reenable(self): - self.run_command('replication-reenable 1234') - self.assert_called('POST', '/volumes/1234/action', - body={'os-reenable-replica': None}) - def test_create_snapshot_from_volume_with_metadata(self): """ Tests create snapshot with --metadata parameter. diff --git a/cinderclient/tests/unit/v2/test_volumes.py b/cinderclient/tests/unit/v2/test_volumes.py index cd47c800c..f3c7d07a3 100644 --- a/cinderclient/tests/unit/v2/test_volumes.py +++ b/cinderclient/tests/unit/v2/test_volumes.py @@ -281,14 +281,6 @@ class VolumesTest(utils.TestCase): cs.assert_called('POST', '/os-snapshot-manage', {'snapshot': expected}) self._assert_request_id(vol) - def test_replication_reenable(self): - v = cs.volumes.get('1234') - self._assert_request_id(v) - vol = cs.volumes.reenable(v) - cs.assert_called('POST', '/volumes/1234/action', - {'os-reenable-replica': None}) - self._assert_request_id(vol) - def test_get_pools(self): vol = cs.volumes.get_pools('') cs.assert_called('GET', '/scheduler-stats/get_pools') diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py index 3716fa755..68c20db03 100644 --- a/cinderclient/v2/shell.py +++ b/cinderclient/v2/shell.py @@ -2236,16 +2236,6 @@ def do_unmanage(cs, args): cs.volumes.unmanage(volume.id) -@utils.arg('volume', metavar='', - help='Name or ID of the volume to reenable replication. ' - 'The replication-status of the volume should be inactive.') -@utils.service_type('volumev2') -def do_replication_reenable(cs, args): - """Sync the secondary volume with primary for a relationship.""" - volume = utils.find_volume(cs, args.volume) - cs.volumes.reenable(volume.id) - - @utils.arg('--all-tenants', dest='all_tenants', metavar='<0|1>', diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py index f1fb193b7..e4bbdb1b8 100644 --- a/cinderclient/v2/volumes.py +++ b/cinderclient/v2/volumes.py @@ -587,10 +587,6 @@ class VolumeManager(base.ManagerWithFind): """Unmanage a volume.""" return self._action('os-unmanage', volume, None) - def reenable(self, volume): - """Sync the secondary volume with primary for a relationship.""" - return self._action('os-reenable-replica', volume, None) - def get_pools(self, detail): """Show pool information for backends.""" query_string = ""