From 4a25828cbd8467a70ac2d7a025be932e544d2ad9 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 11:02:07 +0200
Subject: [PATCH] =?UTF-8?q?Unify=20the=20=E2=80=9C--file-storage-dir?=
 =?UTF-8?q?=E2=80=9D=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: Guido Trotter <ultrotter@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 be7164869..0ff5b435e 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -49,6 +49,7 @@ __all__ = [
   "DEBUG_SIMERR_OPT",
   "DISK_TEMPLATE_OPT",
   "FIELDS_OPT",
+  "FILESTORE_DIR_OPT",
   "FORCE_OPT",
   "NOHDR_OPT",
   "NONICS_OPT",
@@ -487,6 +488,11 @@ NONICS_OPT = cli_option("--no-nics", default=False, action="store_true",
                         help="Do not create any network cards for"
                         " the instance")
 
+FILESTORE_DIR_OPT = cli_option("--file-storage-dir", dest="file_storage_dir",
+                               help="Relative path under default cluster-wide"
+                               " file storage dir to store file-based disks",
+                               default=None, metavar="<DIR>")
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index 372389dcc..2f030e5e8 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -245,10 +245,7 @@ import_opts = [
              help="Select nodes for the instance automatically using the"
              " <NAME> iallocator plugin", default=None, type="string",
              completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
-  cli_option("--file-storage-dir", dest="file_storage_dir",
-             help="Relative path under default cluster-wide file storage dir"
-             " to store file-based disks", default=None,
-             metavar="<DIR>"),
+  FILESTORE_DIR_OPT,
   cli_option("--file-driver", dest="file_driver", help="Driver to use"
              " for image files", default="loop", metavar="<DRIVER>",
              choices=list(constants.FILE_DRIVER)),
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index b4470db71..2598a7aa0 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1396,10 +1396,7 @@ add_opts = [
   cli_option("--no-ip-check", dest="ip_check", default=True,
              action="store_false", help="Don't check that the instance's IP"
              " is alive (only valid with --no-start)"),
-  cli_option("--file-storage-dir", dest="file_storage_dir",
-             help="Relative path under default cluster-wide file storage dir"
-             " to store file-based disks", default=None,
-             metavar="<DIR>"),
+  FILESTORE_DIR_OPT,
   cli_option("--file-driver", dest="file_driver", help="Driver to use"
              " for image files", default="loop", metavar="<DRIVER>",
              choices=list(constants.FILE_DRIVER)),
-- 
GitLab