summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex O'Rourke <alex.orourke@hpe.com>2016-03-01 08:51:53 -0800
committerAlex O'Rourke <alex.orourke@hpe.com>2016-03-01 08:58:38 -0800
commit66f7a083851a6b6adebc4e8b1a5736e1191a409d (patch)
tree52576434dba8970c3258d1b2461cc51c5ac96dc7
parentc4f4ae200a2efd750a8dbcd1e1f6df3a2ddf94e8 (diff)
downloadpython-cinderclient-66f7a083851a6b6adebc4e8b1a5736e1191a409d.tar.gz
Remove replication v2 calls1.6.0
With replication v2.1 merged in cinder and the calls merged in the client, there is no longer a need for the old calls. If these commands are called with the newest cinder code, it fails miserably. Basically reverts this patch: https://review.openstack.org/#/c/231708 Change-Id: I29c0565c1efe518e40c3483ceb4ca0d40cd7d0d7
-rw-r--r--cinderclient/tests/unit/v2/fakes.py8
-rw-r--r--cinderclient/tests/unit/v2/test_shell.py17
-rw-r--r--cinderclient/v2/shell.py54
-rw-r--r--cinderclient/v2/volumes.py56
4 files changed, 0 insertions, 135 deletions
diff --git a/cinderclient/tests/unit/v2/fakes.py b/cinderclient/tests/unit/v2/fakes.py
index 97bac04..7798c29 100644
--- a/cinderclient/tests/unit/v2/fakes.py
+++ b/cinderclient/tests/unit/v2/fakes.py
@@ -447,14 +447,6 @@ class FakeHTTPClient(base_client.HTTPClient):
elif action == 'os-migrate_volume':
assert 'host' in body[action]
assert 'force_host_copy' in body[action]
- elif action == 'os-enable_replication':
- assert body[action] is None
- elif action == 'os-disable_replication':
- assert body[action] is None
- elif action == 'os-list_replication_targets':
- assert body[action] is None
- elif action == 'os-failover_replication':
- assert 'secondary' in body[action]
elif action == 'os-update_readonly_flag':
assert list(body[action]) == ['readonly']
elif action == 'os-retype':
diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py
index ba3511e..d0f82e9 100644
--- a/cinderclient/tests/unit/v2/test_shell.py
+++ b/cinderclient/tests/unit/v2/test_shell.py
@@ -869,23 +869,6 @@ class ShellTest(utils.TestCase):
self.assert_called('POST', '/volumes/1234/action',
body=expected)
- def test_replication_enable(self):
- self.run_command('replication-enable 1234')
- self.assert_called('POST', '/volumes/1234/action')
-
- def test_replication_disable(self):
- self.run_command('replication-disable 1234')
- self.assert_called('POST', '/volumes/1234/action')
-
- def test_replication_list_targets(self):
- self.run_command('replication-list-targets 1234')
- self.assert_called('POST', '/volumes/1234/action')
-
- def test_replication_failover(self):
- self.run_command('replication-failover 1234 target')
- expected = {'os-failover_replication': {'secondary': 'target'}}
- self.assert_called('POST', '/volumes/1234/action', body=expected)
-
def test_snapshot_metadata_set(self):
self.run_command('snapshot-metadata 1234 set key1=val1 key2=val2')
self.assert_called('POST', '/snapshots/1234/metadata',
diff --git a/cinderclient/v2/shell.py b/cinderclient/v2/shell.py
index 409675e..2dec452 100644
--- a/cinderclient/v2/shell.py
+++ b/cinderclient/v2/shell.py
@@ -1287,60 +1287,6 @@ def do_migrate(cs, args):
six.text_type(e)))
-@utils.arg('volume',
- metavar='<volume>',
- help='ID of volume to enable replication.')
-@utils.service_type('volumev2')
-def do_replication_enable(cs, args):
- """Enables volume replication on a given volume."""
- volume = utils.find_volume(cs, args.volume)
- volume.replication_enable(args.volume)
-
-
-@utils.arg('volume',
- metavar='<volume>',
- help='ID of volume to disable replication.')
-@utils.service_type('volumev2')
-def do_replication_disable(cs, args):
- """Disables volume replication on a given volume."""
- volume = utils.find_volume(cs, args.volume)
- volume.replication_disable(args.volume)
-
-
-@utils.arg('volume',
- metavar='<volume>',
- help='ID of volume to list available replication targets.')
-@utils.service_type('volumev2')
-def do_replication_list_targets(cs, args):
- """List replication targets available for a volume."""
- volume = utils.find_volume(cs, args.volume)
- resp, body = volume.replication_list_targets(args.volume)
- if body:
- targets = body['targets']
- columns = ['target_device_id']
- if targets:
- utils.print_list(targets, columns)
- else:
- print("There are no replication targets found for volume %s." %
- args.volume)
- else:
- print("There is no replication information for volume %s." %
- args.volume)
-
-
-@utils.arg('volume',
- metavar='<volume>',
- help='ID of volume to failover.')
-@utils.arg('secondary',
- metavar='<secondary>',
- help='A unique identifier that represents a failover target.')
-@utils.service_type('volumev2')
-def do_replication_failover(cs, args):
- """Failover a volume to a secondary target"""
- volume = utils.find_volume(cs, args.volume)
- volume.replication_failover(args.volume, args.secondary)
-
-
@utils.arg('volume', metavar='<volume>',
help='Name or ID of volume for which to modify type.')
@utils.arg('new_type', metavar='<volume-type>', help='New volume type.')
diff --git a/cinderclient/v2/volumes.py b/cinderclient/v2/volumes.py
index 8cf1ab9..19a0d20 100644
--- a/cinderclient/v2/volumes.py
+++ b/cinderclient/v2/volumes.py
@@ -147,22 +147,6 @@ class Volume(base.Resource):
return self.manager.migrate_volume(self, host, force_host_copy,
lock_volume)
- def replication_enable(self, volume):
- """Enables volume replication on a given volume."""
- return self.manager.replication_enable(volume)
-
- def replication_disable(self, volume):
- """Disables volume replication on a given volume."""
- return self.manager.replication_disable(volume)
-
- def replication_list_targets(self, volume):
- """List replication targets available for a volume."""
- return self.manager.replication_list_targets(volume)
-
- def replication_failover(self, volume, secondary):
- """Failover a volume to a secondary target."""
- return self.manager.replication_failover(volume, secondary)
-
def retype(self, volume_type, policy):
"""Change a volume's type."""
return self.manager.retype(self, volume_type, policy)
@@ -545,46 +529,6 @@ class VolumeManager(base.ManagerWithFind):
'error': error})
return common_base.DictWithMeta(body, resp)
- def replication_enable(self, volume_id):
- """
- Enables volume replication on a given volume.
-
- :param volume_id: The id of the volume to query
- """
- return self._action('os-enable_replication',
- volume_id)
-
- def replication_disable(self, volume_id):
- """
- Disables volume replication on a given volume.
-
- :param volume_id: The id of the volume to query
- """
- return self._action('os-disable_replication',
- volume_id)
-
- def replication_list_targets(self, volume_id):
- """
- List replication targets available for a volume.
-
- :param volume_id: The id of the volume to query
- :return: a list of available replication targets
- """
- return self._action('os-list_replication_targets',
- volume_id)
-
- def replication_failover(self, volume_id, secondary):
- """
- Failover a volume to a secondary target.
-
- :param volume_id: The id of the volume to query
- :param secondary: A unique identifier that represents a failover
- target
- """
- return self._action('os-failover_replication',
- volume_id,
- {"secondary": secondary})
-
def update_all_metadata(self, volume, metadata):
"""Update all metadata of a volume.