diff --git a/lib/cli.py b/lib/cli.py index 1bde7445460d3def794607eabf82ae20544ede3e..3f4d938d8ace6977c62901564c21a131f8d7cb68 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -52,6 +52,7 @@ __all__ = [ "FIELDS_OPT", "FILESTORE_DIR_OPT", "FILESTORE_DRIVER_OPT", + "HVLIST_OPT", "HVOPTS_OPT", "HYPERVISOR_OPT", "IALLOCATOR_OPT", @@ -527,6 +528,11 @@ HYPERVISOR_OPT = cli_option("-H", "--hypervisor-parameters", dest="hypervisor", " format hypervisor:option=value,option=value,...", default=None, type="identkeyval") +HVLIST_OPT = cli_option("-H", "--hypervisor-parameters", dest="hvparams", + help="Hypervisor and hypervisor options, in the" + " format hypervisor:option=value,option=value,...", + default=[], action="append", type="identkeyval") + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index eeea8eebd91d40da24bd829393fe276a7a289a25..33ddd762f535b0f3226661bda22db326b7381001 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -635,12 +635,7 @@ commands = { help="Comma-separated list of hypervisors", type="string", default=constants.DEFAULT_ENABLED_HYPERVISOR), - cli_option("-H", "--hypervisor-parameters", dest="hvparams", - help="Hypervisor and hypervisor options, in the format" - " hypervisor:option=value,option=value,...", - default=[], - action="append", - type="identkeyval"), + HVLIST_OPT, BACKEND_OPT, cli_option("-N", "--nic-parameters", dest="nicparams", type="keyval", default={}, @@ -734,13 +729,7 @@ commands = { cli_option("--enabled-hypervisors", dest="enabled_hypervisors", help="Comma-separated list of hypervisors", type="string", default=None), - cli_option("-H", "--hypervisor-parameters", dest="hvparams", - help="Hypervisor and hypervisor options, in the" - " format" - " hypervisor:option=value,option=value,...", - default=[], - action="append", - type="identkeyval"), + HVLIST_OPT, BACKEND_OPT, cli_option("-N", "--nic-parameters", dest="nicparams", type="keyval", default={},