Update help message for share-instance-reset-state command

Update help message for share-instance-reset-state command
after merging server side change [1] that extended list of allowed states.
[1] Ia23c13f62997d99495d9ecca066475565d9bfc87

Change-Id: I14964f300da344aeb098379cf4da75750f7ce866
Closes-Bug: #1650774
This commit is contained in:
yanjun.fu 2016-12-26 13:57:47 +08:00 committed by yankee
parent a88bfc654d
commit e3bd7b37bf
3 changed files with 31 additions and 2 deletions

View File

@ -89,3 +89,26 @@ class ShareInstancesTest(utils.TestCase):
manager.force_delete(instance)
manager._action.assert_called_once_with(action_name, "1234")
@ddt.data(
("2.6", "1234", "migrating_to"),
("2.6", "1234", "error"),
("2.6", "1234", "available"),
("2.7", "1234", "error_deleting"),
("2.7", "1234", "deleting"),
("2.7", "1234", "migrating"),
)
@ddt.unpack
def test_valid_instance_state(self, microversion, instance, state):
manager = self._get_manager(microversion)
if (api_versions.APIVersion(microversion) >
api_versions.APIVersion("2.6")):
action_name = "reset_status"
else:
action_name = "os-reset_status"
with mock.patch.object(manager, "_action", mock.Mock()):
manager.reset_state(instance, state)
manager._action.assert_called_once_with(
action_name, instance, {"status": state})

View File

@ -1509,8 +1509,8 @@ def do_share_instance_force_delete(cs, args):
metavar='<state>',
default='available',
help=('Indicate which state to assign the instance. Options include '
'available, error, creating, deleting, error_deleting. If no '
'state is provided, available will be used.'))
'available, error, creating, deleting, error_deleting, migrating,'
'migrating_to. If no state is provided, available will be used.'))
@api_versions.wraps("2.3")
def do_share_instance_reset_state(cs, args):
"""Explicitly update the state of a share instance (Admin only)."""

View File

@ -0,0 +1,6 @@
---
fixes:
- Manila now allows modifying the share instance statuses to "migrating"
or "migrating_to". Clarified the help text in the client to include
these statuses.