Commit a14db5ff authored by Iustin Pop's avatar Iustin Pop

Unify the “--new-secondary” option

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent b6e841a8
......@@ -64,6 +64,7 @@ __all__ = [
"IGNORE_FAILURES_OPT",
"FORCE_OPT",
"NET_OPT",
"NEW_SECONDARY_OPT",
"NODE_LIST_OPT",
"NODE_PLACEMENT_OPT",
"NOHDR_OPT",
......@@ -636,6 +637,11 @@ IGNORE_FAILURES_OPT = cli_option("--ignore-failures", dest="ignore_failures",
" configuration even if there are failures"
" during the removal process")
NEW_SECONDARY_OPT = cli_option("-n", "--new-secondary", dest="dst_node",
help="Specifies the new secondary node",
metavar="NODE", default=None,
completion_suggest=OPT_COMPL_ONE_NODE)
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -845,7 +845,7 @@ def ReplaceDisks(opts, args):
"""
instance_name = args[0]
new_2ndary = opts.new_secondary
new_2ndary = opts.dst_node
iallocator = opts.iallocator
if opts.disks is None:
disks = []
......@@ -1436,11 +1436,7 @@ commands = {
"<instance> <new_name>", "Rename the instance"),
'replace-disks': (ReplaceDisks, ARGS_ONE_INSTANCE,
[DEBUG_OPT,
cli_option("-n", "--new-secondary", dest="new_secondary",
help=("New secondary node (for secondary"
" node change)"), metavar="NODE",
default=None,
completion_suggest=OPT_COMPL_ONE_NODE),
NEW_SECONDARY_OPT,
cli_option("-p", "--on-primary", dest="on_primary",
default=False, action="store_true",
help=("Replace the disk(s) on the primary"
......
......@@ -637,12 +637,7 @@ commands = {
"[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
"Add a node to the cluster"),
'evacuate': (EvacuateNode, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT, IALLOCATOR_OPT,
cli_option("-n", "--new-secondary", dest="dst_node",
help="New secondary node", metavar="NODE",
default=None,
completion_suggest=OPT_COMPL_ONE_NODE),
],
[DEBUG_OPT, FORCE_OPT, IALLOCATOR_OPT, NEW_SECONDARY_OPT],
"[-f] {-I <iallocator> | -n <dst>} <node>",
"Relocate the secondary instances from a node"
" to other nodes (only for instances with drbd disk template)"),
......
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