From 990b7886d0c5f741eccf1d3918921c4d93994b35 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 12:57:41 +0200
Subject: [PATCH] =?UTF-8?q?Unify=20the=20=E2=80=9C--node=E2=80=9D=20(as=20?=
 =?UTF-8?q?instance=20placement)=20option?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 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 9062c2ec8..bebe52e2d 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="<pnode>[:<snode>]",
+                                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 c7a981e74..ecca74425 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="<pnode>[:<snode>]",
-             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 84a17e436..d0593e265 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="<pnode>[:<snode>]",
-             completion_suggest=OPT_COMPL_INST_ADD_NODES),
+  NODE_PLACEMENT_OPT,
   OS_OPT,
   BACKEND_OPT,
   DISK_TEMPLATE_OPT,
-- 
GitLab