---
lib/cli.py | 6 ++++++
scripts/gnt-instance | 6 +-----
scripts/gnt-node | 7 +------
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index 3412165..67b89a3 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -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="new_secondary",
+ 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.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index bd1a33d..9dfffc4 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -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"
diff --git a/scripts/gnt-node b/scripts/gnt-node
index baf46f1..75dca86 100755
--- a/scripts/gnt-node
+++ b/scripts/gnt-node
@@ -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)"),
--
1.6.3.3