---
 lib/cli.py           |    6 ++++++
 scripts/gnt-instance |    5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index c2a0709..5afc7b2 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -45,6 +45,7 @@ from optparse import (OptionParser, TitledHelpFormatter,
 __all__ = [
   # Command line options
   "ALL_OPT",
+  "AUTO_REPLACE_OPT",
   "BACKEND_OPT",
   "CLEANUP_OPT",
   "CONFIRM_OPT",
@@ -654,6 +655,11 @@ ON_SECONDARY_OPT = cli_option("-s", "--on-secondary", 
dest="on_secondary",
                               help="Replace the disk(s) on the secondary"
                               " node (only for the drbd template)")
 
+AUTO_REPLACE_OPT = cli_option("-a", "--auto", dest="auto",
+                              default=False, action="store_true",
+                              help="Automatically replace faulty disks"
+                              " (only for the drbd template)")
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index f803855..f5a8a10 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1439,10 +1439,7 @@ commands = {
                      NEW_SECONDARY_OPT,
                      ON_PRIMARY_OPT,
                      ON_SECONDARY_OPT,
-                     cli_option("-a", "--auto", dest="auto",
-                                default=False, action="store_true",
-                                help=("Automatically replace faulty disks"
-                                      " (only for the drbd template)")),
+                     AUTO_REPLACE_OPT,
                      DISKIDX_OPT,
                      IALLOCATOR_OPT,
                      SUBMIT_OPT,
-- 
1.6.3.3

Reply via email to