From b6e841a86f7f5717d5d103c03b9f293ecaa87ca0 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 13:33:36 +0200
Subject: [PATCH] =?UTF-8?q?Move=20the=20=E2=80=9C--ignore-failures?=
 =?UTF-8?q?=E2=80=9D=20option=20to=20cli.py?=
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           | 7 +++++++
 scripts/gnt-instance | 9 +--------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index e58d9511a..341216596 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -61,6 +61,7 @@ __all__ = [
   "HYPERVISOR_OPT",
   "IALLOCATOR_OPT",
   "IGNORE_CONSIST_OPT",
+  "IGNORE_FAILURES_OPT",
   "FORCE_OPT",
   "NET_OPT",
   "NODE_LIST_OPT",
@@ -629,6 +630,12 @@ SELECT_OS_OPT = cli_option("--select-os", dest="select_os",
                            help="Interactive OS reinstall, lists available"
                            " OS templates for selection")
 
+IGNORE_FAILURES_OPT = cli_option("--ignore-failures", dest="ignore_failures",
+                                 action="store_true", default=False,
+                                 help="Remove the instance from the cluster"
+                                 " configuration even if there are failures"
+                                 " during the removal process")
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index d6daeba86..1d1976f87 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1428,14 +1428,7 @@ commands = {
                  ],
                 "[-f] <instance>", "Reinstall a stopped instance"),
   'remove': (RemoveInstance, ARGS_ONE_INSTANCE,
-             [DEBUG_OPT, FORCE_OPT,
-              cli_option("--ignore-failures", dest="ignore_failures",
-                         action="store_true", default=False,
-                         help=("Remove the instance from the cluster even"
-                               " if there are failures during the removal"
-                               " process (shutdown, disk removal, etc.)")),
-              SUBMIT_OPT,
-              ],
+             [DEBUG_OPT, FORCE_OPT, IGNORE_FAILURES_OPT, SUBMIT_OPT],
              "[-f] <instance>", "Shuts down the instance and removes it"),
   'rename': (RenameInstance,
              [ArgInstance(min=1, max=1), ArgHost(min=1, max=1)],
-- 
GitLab