diff --git a/lib/cli.py b/lib/cli.py index bcf8d8b828769e77c676a8ad179439469295ae91..e59422efe9b807898c51bca2432b999298bd1e75 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -71,6 +71,7 @@ __all__ = [ "MC_OPT", "NET_OPT", "NEW_SECONDARY_OPT", + "NIC_PARAMS_OPT", "NODE_LIST_OPT", "NODE_PLACEMENT_OPT", "NOHDR_OPT", @@ -727,6 +728,10 @@ ENABLED_HV_OPT = cli_option("--enabled-hypervisors", help="Comma-separated list of hypervisors", type="string", default=None) +NIC_PARAMS_OPT = cli_option("-N", "--nic-parameters", dest="nicparams", + type="keyval", default={}, + help="NIC parameters") + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index 173f3ded262b98792e2d446b612f184d55c35b88..1a71efac1686a8841c41d179a9d00abf56f0b381 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -622,9 +622,7 @@ commands = { ENABLED_HV_OPT, HVLIST_OPT, BACKEND_OPT, - cli_option("-N", "--nic-parameters", dest="nicparams", - type="keyval", default={}, - help="NIC parameters"), + NIC_PARAMS_OPT, cli_option("-C", "--candidate-pool-size", default=constants.MASTER_POOL_SIZE_DEFAULT, help="Set the candidate pool size", @@ -712,9 +710,7 @@ commands = { ENABLED_HV_OPT, HVLIST_OPT, BACKEND_OPT, - cli_option("-N", "--nic-parameters", dest="nicparams", - type="keyval", default={}, - help="NIC parameters"), + NIC_PARAMS_OPT, cli_option("-C", "--candidate-pool-size", default=None, help="Set the candidate pool size", dest="candidate_pool_size", type="int"),