Commit d3ed23ff authored by Iustin Pop's avatar Iustin Pop
Browse files

Unify the “--os-type” option



This was already unified inside gnt-instance, I just moved that
definition (and upper-cased it) into cli.py.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 4eb62659
......@@ -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.
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment