Remove promote/reenable replication
The replication 1.0 API os-promote-replica and os-reenable-replica were removed[1], then remove useless code from cinderclient. [1]: https://review.openstack.org/#/c/275797/ Change-Id: Icf98f294c089942e11607786e932abc959f77b3b
This commit is contained in:
parent
938c00a972
commit
5cd22bb18a
|
@ -193,12 +193,6 @@ You'll find complete documentation on the shell by running
|
||||||
readonly-mode-update
|
readonly-mode-update
|
||||||
Updates volume read-only access-mode flag.
|
Updates volume read-only access-mode flag.
|
||||||
rename Renames a volume.
|
rename Renames a volume.
|
||||||
replication-promote
|
|
||||||
Promote a secondary volume to primary for a
|
|
||||||
relationship.
|
|
||||||
replication-reenable
|
|
||||||
Sync the secondary volume with primary for a
|
|
||||||
relationship.
|
|
||||||
reset-state Explicitly updates the volume state in the Cinder
|
reset-state Explicitly updates the volume state in the Cinder
|
||||||
database.
|
database.
|
||||||
retype Changes the volume type for a volume.
|
retype Changes the volume type for a volume.
|
||||||
|
|
|
@ -531,10 +531,6 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||||
assert list(body[action]) == ['bootable']
|
assert list(body[action]) == ['bootable']
|
||||||
elif action == 'os-unmanage':
|
elif action == 'os-unmanage':
|
||||||
assert body[action] is None
|
assert body[action] is None
|
||||||
elif action == 'os-promote-replica':
|
|
||||||
assert body[action] is None
|
|
||||||
elif action == 'os-reenable-replica':
|
|
||||||
assert body[action] is None
|
|
||||||
elif action == 'os-set_image_metadata':
|
elif action == 'os-set_image_metadata':
|
||||||
assert list(body[action]) == ['metadata']
|
assert list(body[action]) == ['metadata']
|
||||||
elif action == 'os-unset_image_metadata':
|
elif action == 'os-unset_image_metadata':
|
||||||
|
@ -1241,12 +1237,6 @@ class FakeHTTPClient(base_client.HTTPClient):
|
||||||
snapshot.update(kw['body']['snapshot'])
|
snapshot.update(kw['body']['snapshot'])
|
||||||
return (202, {}, {'snapshot': snapshot})
|
return (202, {}, {'snapshot': snapshot})
|
||||||
|
|
||||||
def post_os_promote_replica_1234(self, **kw):
|
|
||||||
return (202, {}, {})
|
|
||||||
|
|
||||||
def post_os_reenable_replica_1234(self, **kw):
|
|
||||||
return (202, {}, {})
|
|
||||||
|
|
||||||
def get_scheduler_stats_get_pools(self, **kw):
|
def get_scheduler_stats_get_pools(self, **kw):
|
||||||
stats = [
|
stats = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1131,16 +1131,6 @@ class ShellTest(utils.TestCase):
|
||||||
self.assert_called('POST', '/volumes/1234/action',
|
self.assert_called('POST', '/volumes/1234/action',
|
||||||
body={'os-unmanage': None})
|
body={'os-unmanage': None})
|
||||||
|
|
||||||
def test_replication_promote(self):
|
|
||||||
self.run_command('replication-promote 1234')
|
|
||||||
self.assert_called('POST', '/volumes/1234/action',
|
|
||||||
body={'os-promote-replica': 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):
|
def test_create_snapshot_from_volume_with_metadata(self):
|
||||||
"""
|
"""
|
||||||
Tests create snapshot with --metadata parameter.
|
Tests create snapshot with --metadata parameter.
|
||||||
|
|
|
@ -300,22 +300,6 @@ class VolumesTest(utils.TestCase):
|
||||||
cs.volume_snapshots.list_manageable('host1', detailed=True)
|
cs.volume_snapshots.list_manageable('host1', detailed=True)
|
||||||
cs.assert_called('GET', '/os-snapshot-manage/detail?host=host1')
|
cs.assert_called('GET', '/os-snapshot-manage/detail?host=host1')
|
||||||
|
|
||||||
def test_replication_promote(self):
|
|
||||||
v = cs.volumes.get('1234')
|
|
||||||
self._assert_request_id(v)
|
|
||||||
vol = cs.volumes.promote(v)
|
|
||||||
cs.assert_called('POST', '/volumes/1234/action',
|
|
||||||
{'os-promote-replica': None})
|
|
||||||
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):
|
def test_get_pools(self):
|
||||||
vol = cs.volumes.get_pools('')
|
vol = cs.volumes.get_pools('')
|
||||||
cs.assert_called('GET', '/scheduler-stats/get_pools')
|
cs.assert_called('GET', '/scheduler-stats/get_pools')
|
||||||
|
|
|
@ -2061,25 +2061,6 @@ def do_unmanage(cs, args):
|
||||||
cs.volumes.unmanage(volume.id)
|
cs.volumes.unmanage(volume.id)
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('volume', metavar='<volume>',
|
|
||||||
help='Name or ID of the volume to promote. '
|
|
||||||
'The volume should have the replica volume created with '
|
|
||||||
'source-replica argument.')
|
|
||||||
def do_replication_promote(cs, args):
|
|
||||||
"""Promote a secondary volume to primary for a relationship."""
|
|
||||||
volume = utils.find_volume(cs, args.volume)
|
|
||||||
cs.volumes.promote(volume.id)
|
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('volume', metavar='<volume>',
|
|
||||||
help='Name or ID of the volume to reenable replication. '
|
|
||||||
'The replication-status of the volume should be inactive.')
|
|
||||||
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',
|
@utils.arg('--all-tenants',
|
||||||
dest='all_tenants',
|
dest='all_tenants',
|
||||||
metavar='<0|1>',
|
metavar='<0|1>',
|
||||||
|
|
|
@ -219,14 +219,6 @@ class Volume(base.Resource):
|
||||||
"""Unmanage a volume."""
|
"""Unmanage a volume."""
|
||||||
return self.manager.unmanage(volume)
|
return self.manager.unmanage(volume)
|
||||||
|
|
||||||
def promote(self, volume):
|
|
||||||
"""Promote secondary to be primary in relationship."""
|
|
||||||
return self.manager.promote(volume)
|
|
||||||
|
|
||||||
def reenable(self, volume):
|
|
||||||
"""Sync the secondary volume with primary for a relationship."""
|
|
||||||
return self.manager.reenable(volume)
|
|
||||||
|
|
||||||
def get_pools(self, detail):
|
def get_pools(self, detail):
|
||||||
"""Show pool information for backends."""
|
"""Show pool information for backends."""
|
||||||
return self.manager.get_pools(detail)
|
return self.manager.get_pools(detail)
|
||||||
|
@ -639,14 +631,6 @@ class VolumeManager(base.ManagerWithFind):
|
||||||
"""Unmanage a volume."""
|
"""Unmanage a volume."""
|
||||||
return self._action('os-unmanage', volume, None)
|
return self._action('os-unmanage', volume, None)
|
||||||
|
|
||||||
def promote(self, volume):
|
|
||||||
"""Promote secondary to be primary in relationship."""
|
|
||||||
return self._action('os-promote-replica', 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):
|
def get_pools(self, detail):
|
||||||
"""Show pool information for backends."""
|
"""Show pool information for backends."""
|
||||||
query_string = ""
|
query_string = ""
|
||||||
|
|
|
@ -693,14 +693,6 @@ cinder usage
|
||||||
``rename``
|
``rename``
|
||||||
Renames a volume.
|
Renames a volume.
|
||||||
|
|
||||||
``replication-promote``
|
|
||||||
Promote a secondary volume to primary for a
|
|
||||||
relationship.
|
|
||||||
|
|
||||||
``replication-reenable``
|
|
||||||
Sync the secondary volume with primary for a
|
|
||||||
relationship.
|
|
||||||
|
|
||||||
``reset-state``
|
``reset-state``
|
||||||
Explicitly updates the entity state in the Cinder
|
Explicitly updates the entity state in the Cinder
|
||||||
database.
|
database.
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
prelude: >
|
||||||
|
The replication v1 have been removed from cinder, the volume promote/reenable
|
||||||
|
replication on the command line have now been removed.
|
Loading…
Reference in New Issue