System peer CLI options change to choice

Change "dcmanager system-peer add --heartbeat-failure-policy
--administrative-state" to choice;
Change "dcmanager system-peer update --administrative-state" and
"dcmanager system-peer update --heartbeat-failure-policy" to
choice.

Test Plan:
1. PASS - Run 'dcmanager system-peer add --heartbeat-failure-policy
          --administrative-state' with correct choice and verify
          that the command work as expected;
2. PASS - Run 'dcmanager system-peer update --administrative-state'
          'dcmanager system-peer update --heartbeat-failure-policy'
          with correct choice and verify that the command work as
          expected;
3. PASS - Run 'dcmanager system-peer add --heartbeat-failure-policy
          --administrative-state' with wrong choice and verify
          that the error message prompted;
4. PASS - Run 'dcmanager system-peer update --administrative-state'
          'dcmanager system-peer update --heartbeat-failure-policy'
          with wrong choice and verify that the error message
          prompted;
5. PASS - Verify 'dcmanager help system-peer add' and 'dcmanager
          help system-peer update' output the correct messages.

Story: 2010852
Task: 48487

Change-Id: I626fc0ccd156224e643940d208848ba832ccf25d
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
This commit is contained in:
Zhang Rong(Jon) 2023-10-31 11:36:06 +08:00
parent 59084472a5
commit 7e2021bbe0
1 changed files with 8 additions and 8 deletions

View File

@ -127,9 +127,9 @@ class AddSystemPeer(base.DCManagerShowOne):
parser.add_argument(
'--administrative-state',
required=False,
choices=['enabled', 'disabled'],
default='enabled',
help='Administrative control of peer state (enabled | disabled) \
(default enabled).'
help='Administrative control of peer state (default enabled).'
)
parser.add_argument(
@ -151,9 +151,9 @@ class AddSystemPeer(base.DCManagerShowOne):
parser.add_argument(
'--heartbeat-failure-policy',
required=False,
choices=['alarm', 'rehome', 'delegate'],
default='alarm',
help='Action to take with failure detection \
(alarm | rehome | delegate) (default alarm).'
help='Action to take with failure detection (default alarm).'
)
parser.add_argument(
@ -334,8 +334,8 @@ class UpdateSystemPeer(base.DCManagerShowOne):
parser.add_argument(
'--administrative-state',
required=False,
help='Administrative control of peer state (enabled | disabled) \
(default enabled).'
choices=['enabled', 'disabled'],
help='Administrative control of peer state (default enabled).'
)
parser.add_argument(
@ -355,8 +355,8 @@ class UpdateSystemPeer(base.DCManagerShowOne):
parser.add_argument(
'--heartbeat-failure-policy',
required=False,
help='Action to take with failure detection \
(alarm | rehome | delegate) (default alarm).'
choices=['alarm', 'rehome', 'delegate'],
help='Action to take with failure detection (default alarm).'
)
parser.add_argument(