From f92ed8abbb626c23e58dd77d69c85ceb45d0a75f Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Thu, 15 Nov 2012 10:01:38 +0100
Subject: [PATCH] Move gnt_cluster.SHOW_MACHINE_OPT to cli

This allows the option to be re-used in other places.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/cli.py                | 5 +++++
 lib/client/gnt_cluster.py | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index dae3bf7e5..76be606ab 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -169,6 +169,7 @@ __all__ = [
   "SELECT_OS_OPT",
   "SEP_OPT",
   "SHOWCMD_OPT",
+  "SHOW_MACHINE_OPT",
   "SHUTDOWN_TIMEOUT_OPT",
   "SINGLE_NODE_OPT",
   "SPECS_CPU_COUNT_OPT",
@@ -1335,6 +1336,10 @@ PRIMARY_IP_VERSION_OPT = \
                                   constants.IP6_VERSION),
                help="Cluster-wide IP version for primary IP")
 
+SHOW_MACHINE_OPT = cli_option("-M", "--show-machine-names", default=False,
+                              action="store_true",
+                              help="Show machine name for every line in output")
+
 
 def _PriorityOptionCb(option, _, value, parser):
   """Callback for processing C{--priority} option.
diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index ec06e1cc4..ecfa4ce75 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -53,10 +53,6 @@ GROUPS_OPT = cli_option("--groups", default=False,
                         action="store_true", dest="groups",
                         help="Arguments are node groups instead of nodes")
 
-SHOW_MACHINE_OPT = cli_option("-M", "--show-machine-names", default=False,
-                              action="store_true",
-                              help="Show machine name for every line in output")
-
 FORCE_FAILOVER = cli_option("--yes-do-it", dest="yes_do_it",
                             help="Override interactive check for --no-voting",
                             default=False, action="store_true")
-- 
GitLab