Merge "Remove invalid 'unlock-volume' migration arg"

This commit is contained in:
Zuul 2018-11-08 19:11:06 +00:00 committed by Gerrit Code Review
commit 51986b1eae
4 changed files with 7 additions and 41 deletions

View File

@ -222,7 +222,7 @@ Migrate volume to a new host
openstack volume migrate
--host <host>
[--force-host-copy]
[--lock-volume | --unlock-volume]
[--lock-volume]
<volume>
.. option:: --host <host>
@ -241,13 +241,6 @@ Migrate volume to a new host
*Volume version 2 only*
.. option:: --unlock-volume
If specified, the volume state will not be locked and the a
migration can be aborted (default) (possibly by another operation)
*Volume version 2 only*
.. _volume_migrate-volume:
.. describe:: <volume>

View File

@ -1188,7 +1188,6 @@ class TestVolumeMigrate(TestVolume):
verifylist = [
("force_host_copy", False),
("lock_volume", False),
("unlock_volume", False),
("host", "host@backend-name#pool"),
("volume", self._volume.id),
]
@ -1210,7 +1209,6 @@ class TestVolumeMigrate(TestVolume):
verifylist = [
("force_host_copy", True),
("lock_volume", True),
("unlock_volume", False),
("host", "host@backend-name#pool"),
("volume", self._volume.id),
]
@ -1222,27 +1220,6 @@ class TestVolumeMigrate(TestVolume):
self._volume.id, "host@backend-name#pool", True, True)
self.assertIsNone(result)
def test_volume_migrate_with_unlock_volume(self):
arglist = [
"--unlock-volume",
"--host", "host@backend-name#pool",
self._volume.id,
]
verifylist = [
("force_host_copy", False),
("lock_volume", False),
("unlock_volume", True),
("host", "host@backend-name#pool"),
("volume", self._volume.id),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
result = self.cmd.take_action(parsed_args)
self.volumes_mock.get.assert_called_once_with(self._volume.id)
self.volumes_mock.migrate_volume.assert_called_once_with(
self._volume.id, "host@backend-name#pool", False, False)
self.assertIsNone(result)
def test_volume_migrate_without_host(self):
arglist = [
self._volume.id,
@ -1250,7 +1227,6 @@ class TestVolumeMigrate(TestVolume):
verifylist = [
("force_host_copy", False),
("lock_volume", False),
("unlock_volume", False),
("volume", self._volume.id),
]

View File

@ -480,21 +480,13 @@ class MigrateVolume(command.Command):
help=_("Enable generic host-based force-migration, "
"which bypasses driver optimizations")
)
lock_group = parser.add_mutually_exclusive_group()
lock_group.add_argument(
parser.add_argument(
'--lock-volume',
action="store_true",
help=_("If specified, the volume state will be locked "
"and will not allow a migration to be aborted "
"(possibly by another operation)")
)
lock_group.add_argument(
'--unlock-volume',
action="store_true",
help=_("If specified, the volume state will not be "
"locked and the a migration can be aborted "
"(default) (possibly by another operation)")
)
return parser
def take_action(self, parsed_args):

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``volume migrate --unlock`` argument did not actually do anything and
has now been removed.