From ff00c1a7ec7e0ca66f11950d2187fc3892016bac Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 12:48:00 +0200
Subject: [PATCH] =?UTF-8?q?Unify=20the=20=E2=80=9C--os-size=E2=80=9D=20opt?=
 =?UTF-8?q?ion?=
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 ac72c3428..5047d5d6d 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -65,6 +65,7 @@ __all__ = [
   "NONICS_OPT",
   "NWSYNC_OPT",
   "OS_OPT",
+  "OS_SIZE_OPT",
   "SEP_OPT",
   "SUBMIT_OPT",
   "SYNC_OPT",
@@ -554,6 +555,11 @@ DISKIDX_OPT = cli_option("--disks", dest="disks", default=None,
                          " indices to act on (e.g. 0,2) (optional,"
                          " defaults to all disks)")
 
+OS_SIZE_OPT = cli_option("-s", "--os-size", dest="sd_size",
+                         help="Enforces a single-disk configuration using the"
+                         " given disk size, in MiB unless a suffix is used",
+                         default=None, type="unit", metavar="<size>")
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index 242de2ede..c7a981e74 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -218,10 +218,7 @@ import_opts = [
   BACKEND_OPT,
   DISK_TEMPLATE_OPT,
   DISK_OPT,
-  cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
-             " single-disk configuration, when not using the --disk option,"
-             " in MiB unless a suffix is used",
-             default=None, type="unit", metavar="<size>"),
+  OS_SIZE_OPT,
   NET_OPT,
   NONICS_OPT,
   NWSYNC_OPT,
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index b825dda7b..9c7dd84d6 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1370,10 +1370,7 @@ add_opts = [
   OS_OPT,
   BACKEND_OPT,
   DISK_TEMPLATE_OPT,
-  cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
-             " single-disk configuration, when not using the --disk option,"
-             " in MiB unless a suffix is used",
-             default=None, type="unit", metavar="<size>"),
+  OS_SIZE_OPT,
   DISK_OPT,
   NET_OPT,
   NONICS_OPT,
-- 
GitLab