Commit f36d7d81 authored by Iustin Pop's avatar Iustin Pop

Unify the last “--node” (single node) option

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7edc4637
......@@ -71,6 +71,7 @@ __all__ = [
"OS_OPT",
"OS_SIZE_OPT",
"SEP_OPT",
"SINGLE_NODE_OPT",
"SUBMIT_OPT",
"SYNC_OPT",
"TAG_SRC_OPT",
......@@ -587,6 +588,10 @@ NODE_LIST_OPT = cli_option("-n", "--node", dest="nodes", default=[],
" times, if not given defaults to all nodes)",
completion_suggest=OPT_COMPL_ONE_NODE)
SINGLE_NODE_OPT = cli_option("-n", "--node", dest="node", help="Target node",
metavar="<node>",
completion_suggest=OPT_COMPL_ONE_NODE)
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -236,10 +236,7 @@ commands = {
[DEBUG_OPT, NODE_LIST_OPT],
"", "Lists instance exports available in the ganeti cluster"),
'export': (ExportInstance, ARGS_ONE_INSTANCE,
[DEBUG_OPT, FORCE_OPT,
cli_option("-n", "--node", dest="node", help="Target node",
metavar="<node>",
completion_suggest=OPT_COMPL_ONE_NODE),
[DEBUG_OPT, FORCE_OPT, SINGLE_NODE_OPT,
cli_option("","--noshutdown", dest="shutdown",
action="store_false", default=True,
help="Don't shutdown the instance (unsafe)"), ],
......
......@@ -971,7 +971,7 @@ def MoveInstance(opts, args):
return 1
op = opcodes.OpMoveInstance(instance_name=instance_name,
target_node=opts.target_node)
target_node=opts.node)
SubmitOrSend(op, opts, cl=cl)
return 0
......@@ -1328,11 +1328,6 @@ def SetInstanceParams(opts, args):
return 0
# options used in more than one cmd
node_opt = cli_option("-n", "--node", dest="node", help="Target node",
metavar="<node>",
completion_suggest=OPT_COMPL_ONE_NODE)
# multi-instance selection options
m_force_multi = cli_option("--force-multiple", dest="force_multi",
help="Do not ask for confirmation when more than"
......@@ -1418,12 +1413,7 @@ commands = {
"Migrate instance to its secondary node"
" (only for instances of type drbd)"),
'move': (MoveInstance, ARGS_ONE_INSTANCE,
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT,
cli_option("-n", "--new-node", dest="target_node",
help="Destinattion node", metavar="NODE",
default=None,
completion_suggest=OPT_COMPL_ONE_NODE),
],
[DEBUG_OPT, FORCE_OPT, SUBMIT_OPT, SINGLE_NODE_OPT],
"[-f] <instance>",
"Move instance to an arbitrary node"
" (only for instances of type file and lv)"),
......
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