diff --git a/lib/cli.py b/lib/cli.py index 180aa2735be923cb46b13b67f714163158a92c0b..dbea1d7a6e2c28b1253407ad109c64559bfdf64f 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -56,6 +56,7 @@ __all__ = [ "NOHDR_OPT", "NONICS_OPT", "NWSYNC_OPT", + "OS_OPT", "SEP_OPT", "SUBMIT_OPT", "SYNC_OPT", @@ -506,6 +507,10 @@ IALLOCATOR_OPT = cli_option("-I", "--iallocator", metavar="<NAME>", default=None, type="string", completion_suggest=OPT_COMPL_ONE_IALLOCATOR) +OS_OPT = cli_option("-o", "--os-type", dest="os", help="What OS to run", + metavar="<os>", + completion_suggest=OPT_COMPL_ONE_OS) + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-debug b/scripts/gnt-debug index d31d082f829f8872f9c8bd14030a80756ef531af..e8be29f019294dc6fd2482d62505e663bb9a8ae8 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -200,9 +200,7 @@ commands = { help="Comma separated list of nics, each nic" " definition is of form mac/ip/bridge, if" " missing values are replace by None"), - cli_option("-o", "--os-type", default=None, - help="Select os for the instance", - completion_suggest=OPT_COMPL_ONE_OS), + OS_OPT, cli_option("-p", "--vcpus", default=1, type="int", help="Select number of VCPUs for the instance"), cli_option("--tags", default=None, diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 7aa4ad4d955566f97dcb4958d19042117ac292dd..d1c2b31a65a25f05131fa92547f9d7d92635da2f 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1333,10 +1333,6 @@ node_opt = cli_option("-n", "--node", dest="node", help="Target node", metavar="<node>", completion_suggest=OPT_COMPL_ONE_NODE) -os_opt = cli_option("-o", "--os-type", dest="os", help="What OS to run", - metavar="<os>", - completion_suggest=OPT_COMPL_ONE_OS) - # multi-instance selection options m_force_multi = cli_option("--force-multiple", dest="force_multi", help="Do not ask for confirmation when more than" @@ -1371,7 +1367,7 @@ add_opts = [ help="Target node and optional secondary node", metavar="<pnode>[:<snode>]", completion_suggest=OPT_COMPL_INST_ADD_NODES), - os_opt, + OS_OPT, cli_option("-B", "--backend", dest="beparams", type="keyval", default={}, help="Backend parameters"), @@ -1485,7 +1481,7 @@ commands = { " list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS), ), 'reinstall': (ReinstallInstance, [ArgInstance(min=1)], - [DEBUG_OPT, FORCE_OPT, os_opt, + [DEBUG_OPT, FORCE_OPT, OS_OPT, m_force_multi, m_node_opt, m_pri_node_opt, m_sec_node_opt, m_clust_opt, m_inst_opt,