Skip to content

Commit 51986b1

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove invalid 'unlock-volume' migration arg"
2 parents c3a60e1 + f00ffeb commit 51986b1

4 files changed

Lines changed: 7 additions & 41 deletions

File tree

doc/source/cli/command-objects/volume.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Migrate volume to a new host
222222
openstack volume migrate
223223
--host <host>
224224
[--force-host-copy]
225-
[--lock-volume | --unlock-volume]
225+
[--lock-volume]
226226
<volume>
227227
228228
.. option:: --host <host>
@@ -241,13 +241,6 @@ Migrate volume to a new host
241241
242242
*Volume version 2 only*
243243
244-
.. option:: --unlock-volume
245-
246-
If specified, the volume state will not be locked and the a
247-
migration can be aborted (default) (possibly by another operation)
248-
249-
*Volume version 2 only*
250-
251244
.. _volume_migrate-volume:
252245
.. describe:: <volume>
253246

openstackclient/tests/unit/volume/v2/test_volume.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,6 @@ def test_volume_migrate(self):
11881188
verifylist = [
11891189
("force_host_copy", False),
11901190
("lock_volume", False),
1191-
("unlock_volume", False),
11921191
("host", "host@backend-name#pool"),
11931192
("volume", self._volume.id),
11941193
]
@@ -1210,7 +1209,6 @@ def test_volume_migrate_with_option(self):
12101209
verifylist = [
12111210
("force_host_copy", True),
12121211
("lock_volume", True),
1213-
("unlock_volume", False),
12141212
("host", "host@backend-name#pool"),
12151213
("volume", self._volume.id),
12161214
]
@@ -1222,35 +1220,13 @@ def test_volume_migrate_with_option(self):
12221220
self._volume.id, "host@backend-name#pool", True, True)
12231221
self.assertIsNone(result)
12241222

1225-
def test_volume_migrate_with_unlock_volume(self):
1226-
arglist = [
1227-
"--unlock-volume",
1228-
"--host", "host@backend-name#pool",
1229-
self._volume.id,
1230-
]
1231-
verifylist = [
1232-
("force_host_copy", False),
1233-
("lock_volume", False),
1234-
("unlock_volume", True),
1235-
("host", "host@backend-name#pool"),
1236-
("volume", self._volume.id),
1237-
]
1238-
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
1239-
1240-
result = self.cmd.take_action(parsed_args)
1241-
self.volumes_mock.get.assert_called_once_with(self._volume.id)
1242-
self.volumes_mock.migrate_volume.assert_called_once_with(
1243-
self._volume.id, "host@backend-name#pool", False, False)
1244-
self.assertIsNone(result)
1245-
12461223
def test_volume_migrate_without_host(self):
12471224
arglist = [
12481225
self._volume.id,
12491226
]
12501227
verifylist = [
12511228
("force_host_copy", False),
12521229
("lock_volume", False),
1253-
("unlock_volume", False),
12541230
("volume", self._volume.id),
12551231
]
12561232

openstackclient/volume/v2/volume.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -480,21 +480,13 @@ def get_parser(self, prog_name):
480480
help=_("Enable generic host-based force-migration, "
481481
"which bypasses driver optimizations")
482482
)
483-
lock_group = parser.add_mutually_exclusive_group()
484-
lock_group.add_argument(
483+
parser.add_argument(
485484
'--lock-volume',
486485
action="store_true",
487486
help=_("If specified, the volume state will be locked "
488487
"and will not allow a migration to be aborted "
489488
"(possibly by another operation)")
490489
)
491-
lock_group.add_argument(
492-
'--unlock-volume',
493-
action="store_true",
494-
help=_("If specified, the volume state will not be "
495-
"locked and the a migration can be aborted "
496-
"(default) (possibly by another operation)")
497-
)
498490
return parser
499491

500492
def take_action(self, parsed_args):
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
upgrade:
3+
- |
4+
The ``volume migrate --unlock`` argument did not actually do anything and
5+
has now been removed.

0 commit comments

Comments
 (0)