---
 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 67b89a3..b754db2 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -73,6 +73,7 @@ __all__ = [
   "NONLIVE_OPT",
   "NOSTART_OPT",
   "NWSYNC_OPT",
+  "ON_PRIMARY_OPT",
   "OS_OPT",
   "OS_SIZE_OPT",
   "SELECT_OS_OPT",
@@ -642,6 +643,11 @@ NEW_SECONDARY_OPT = cli_option("-n", "--new-secondary", 
dest="new_secondary",
                                metavar="NODE", default=None,
                                completion_suggest=OPT_COMPL_ONE_NODE)
 
+ON_PRIMARY_OPT = cli_option("-p", "--on-primary", dest="on_primary",
+                            default=False, action="store_true",
+                            help="Replace the disk(s) on the primary"
+                            " node (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 9dfffc4..8ae812a 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1437,10 +1437,7 @@ commands = {
   'replace-disks': (ReplaceDisks, ARGS_ONE_INSTANCE,
                     [DEBUG_OPT,
                      NEW_SECONDARY_OPT,
-                     cli_option("-p", "--on-primary", dest="on_primary",
-                                default=False, action="store_true",
-                                help=("Replace the disk(s) on the primary"
-                                      " node (only for the drbd template)")),
+                     ON_PRIMARY_OPT,
                      cli_option("-s", "--on-secondary", dest="on_secondary",
                                 default=False, action="store_true",
                                 help=("Replace the disk(s) on the secondary"
-- 
1.6.3.3

Reply via email to