adjust argparse metavar for command help function

'system help addrpool-add' or 'system help addrpool-modify' does not
take effect and print empty.

simplify metavar and move parameter's grammar to help
addrpool_add,addrpool_modify,cluster_add and cluster_modify function
are modified accordingly.

Closes-Bug: #1807091

Change-Id: I87bfbf46855d257623454a5723a4d843d9f5ec18
Signed-off-by: Sun Austin <austin.sun@intel.com>
This commit is contained in:
Sun Austin 2018-12-06 13:26:54 +08:00
parent 025a8cc03c
commit 23415e801b
2 changed files with 12 additions and 8 deletions

View File

@ -83,8 +83,9 @@ def _get_range_tuples(data):
metavar='<network prefix>',
help="Network IP address prefix length [REQUIRED]")
@utils.arg('--ranges',
metavar='<start-end>,[<start-end],...',
help="The inclusive range of addresses to allocate")
metavar='<ranges>',
help="The inclusive range of addresses to allocate "
"<startaddr1-endaddr1>[,<startaddr2-endaddr2>,...]")
@utils.arg('--order',
metavar='<sequential | random>',
help="The allocation order within the start/end range")
@ -116,8 +117,9 @@ def do_addrpool_add(cc, args):
metavar='<name>',
help="Name of the Address Pool]")
@utils.arg('--ranges',
metavar='<start-end>,[<start-end],...',
help="The inclusive range of addresses to allocate")
metavar='<ranges>',
help="The inclusive range of addresses to allocate "
"<startaddr1-endaddr1>[,<startaddr2-endaddr2>,...]")
@utils.arg('--order',
metavar='<sequential | random>',
help="The allocation order within the start/end range")

View File

@ -86,8 +86,9 @@ if os.path.exists('/var/run/.sysinv_running_in_lab'):
metavar='<name>',
help='Name of the Cluster [REQUIRED]')
@utils.arg('--peers',
metavar='<name~status>,[<name~status],...',
help='The inclusive range of peers to allocate')
metavar='<peers>',
help='The inclusive range of peers to allocate '
"<name~status>[,<name~status>,...]")
def do_cluster_add(cc, args):
"""Add Cluster."""
@ -115,8 +116,9 @@ if os.path.exists('/var/run/.sysinv_running_in_lab'):
metavar='<name>',
help="Name of the Cluster")
@utils.arg('--peers',
metavar='<name-status>,[<name-status],...',
help="The inclusive range of peers to allocate")
metavar='<peers>',
help="The inclusive range of peers to allocate "
"<name~status>[,<name~status>,...]")
def do_cluster_modify(cc, args):
"""Modify Cluster attributes."""