From 05586c9011943e88e6e2dd83e2ae07ef721cd452 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 13:41:31 +0200
Subject: [PATCH] =?UTF-8?q?Move=20the=20=E2=80=9C--ignore-size=E2=80=9D=20?=
 =?UTF-8?q?option=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 | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index 23106bd1f..1053d4fed 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -63,6 +63,7 @@ __all__ = [
   "IALLOCATOR_OPT",
   "IGNORE_CONSIST_OPT",
   "IGNORE_FAILURES_OPT",
+  "IGNORE_SIZE_OPT",
   "FORCE_OPT",
   "NET_OPT",
   "NEW_SECONDARY_OPT",
@@ -660,6 +661,12 @@ AUTO_REPLACE_OPT = cli_option("-a", "--auto", dest="auto",
                               help="Automatically replace faulty disks"
                               " (only for the drbd template)")
 
+IGNORE_SIZE_OPT = cli_option("--ignore-size", dest="ignore_size",
+                             default=False, action="store_true",
+                             help="Ignore current recorded size"
+                             " (useful for forcing activation when"
+                             " the recorded size is wrong)")
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 7a7f734bd..8f59ffe18 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1481,13 +1481,7 @@ commands = {
                ],
             "<instance>", "Reboots an instance"),
   'activate-disks': (ActivateDisks, ARGS_ONE_INSTANCE,
-                     [DEBUG_OPT, SUBMIT_OPT,
-                      cli_option("--ignore-size", dest="ignore_size",
-                                 default=False, action="store_true",
-                                 help="Ignore current recorded size"
-                                 " (useful for forcing activation when"
-                                 " the recorded size is wrong)"),
-                      ],
+                     [DEBUG_OPT, SUBMIT_OPT, IGNORE_SIZE_OPT],
                      "<instance>",
                      "Activate an instance's disks"),
   'deactivate-disks': (DeactivateDisks, ARGS_ONE_INSTANCE,
-- 
GitLab