From 990b7886d0c5f741eccf1d3918921c4d93994b35 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 17 Sep 2009 12:57:41 +0200 Subject: [PATCH] =?utf8?q?Unify=20the=20=E2=80=9C--node=E2=80=9D=20(as=20ins?= =?utf8?q?tance=20placement)=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Iustin Pop Reviewed-by: Michael Hanselmann --- lib/cli.py | 6 ++++++ scripts/gnt-backup | 5 +---- scripts/gnt-instance | 5 +---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/cli.py b/lib/cli.py index 9062c2e..bebe52e 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -61,6 +61,7 @@ __all__ = [ "IGNORE_CONSIST_OPT", "FORCE_OPT", "NET_OPT", + "NODE_PLACEMENT_OPT", "NOHDR_OPT", "NOIPCHECK_OPT", "NONICS_OPT", @@ -574,6 +575,11 @@ NONLIVE_OPT = cli_option("--non-live", dest="live", " freeze the instance, save the state, transfer and" " only then resume running on the secondary node)") +NODE_PLACEMENT_OPT = cli_option("-n", "--node", dest="node", + help="Target node and optional secondary node", + metavar="[:]", + completion_suggest=OPT_COMPL_INST_ADD_NODES) + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-backup b/scripts/gnt-backup index c7a981e..ecca744 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -211,10 +211,7 @@ def RemoveExport(opts, args): # this is defined separately due to readability only import_opts = [ DEBUG_OPT, - cli_option("-n", "--node", dest="node", - help="Target node and optional secondary node", - metavar="[:]", - completion_suggest=OPT_COMPL_INST_ADD_NODES), + NODE_PLACEMENT_OPT, BACKEND_OPT, DISK_TEMPLATE_OPT, DISK_OPT, diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 84a17e4..d0593e2 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1363,10 +1363,7 @@ m_inst_opt = cli_option("--instance", dest="multi_mode", # this is defined separately due to readability only add_opts = [ DEBUG_OPT, - cli_option("-n", "--node", dest="node", - help="Target node and optional secondary node", - metavar="[:]", - completion_suggest=OPT_COMPL_INST_ADD_NODES), + NODE_PLACEMENT_OPT, OS_OPT, BACKEND_OPT, DISK_TEMPLATE_OPT, -- 1.7.10.4