From f91e255a52d43532fb1d52ead696dc69c547c521 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 26 Oct 2010 17:43:37 +0200
Subject: [PATCH] Add master_capab to gnt-node modify
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>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 lib/cli.py        | 5 +++++
 man/gnt-node.sgml | 5 +++--
 scripts/gnt-node  | 3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index 4575b055c..a4c0de394 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -53,6 +53,7 @@ __all__ = [
   "AUTO_REPLACE_OPT",
   "BACKEND_OPT",
   "BLK_OS_OPT",
+  "CAPAB_MASTER_OPT",
   "CLEANUP_OPT",
   "CLUSTER_DOMAIN_SECRET_OPT",
   "CONFIRM_OPT",
@@ -870,6 +871,10 @@ DRAINED_OPT = cli_option("-D", "--drained", dest="drained", metavar=_YORNO,
                          type="bool", default=None,
                          help="Set the drained flag on the node")
 
+CAPAB_MASTER_OPT = cli_option("--master-capable", dest="master_capable",
+                    type="bool", default=None, metavar=_YORNO,
+                    help="Set the master_capable flag on the node")
+
 ALLOCATABLE_OPT = cli_option("--allocatable", dest="allocatable",
                              type="bool", default=None, metavar=_YORNO,
                              help="Set the allocatable flag on a volume")
diff --git a/man/gnt-node.sgml b/man/gnt-node.sgml
index 130718dae..39e169f73 100644
--- a/man/gnt-node.sgml
+++ b/man/gnt-node.sgml
@@ -626,6 +626,7 @@
         <arg>--master-candidate=<option>yes|no</option></arg>
         <arg>--drained=<option>yes|no</option></arg>
         <arg>--offline=<option>yes|no</option></arg>
+        <arg>--master-capable=<option>yes|no</option></arg>
         <arg>--auto-promote</arg>
         <arg choice="req"><replaceable>node</replaceable></arg>
       </cmdsynopsis>
@@ -634,8 +635,8 @@
         This command changes the role of the node. Each options takes
         either a literal <literal>yes</literal> or
         <literal>no</literal>, and only one option should be given as
-        <literal>yes</literal>. The meaning of the roles are described
-        in the manpage <citerefentry>
+        <literal>yes</literal>. The meaning of the roles and flags are
+        described in the manpage <citerefentry>
         <refentrytitle>ganeti</refentrytitle> <manvolnum>7</manvolnum>
         </citerefentry>.
       </para>
diff --git a/scripts/gnt-node b/scripts/gnt-node
index 3fa5ff939..645c5439a 100755
--- a/scripts/gnt-node
+++ b/scripts/gnt-node
@@ -659,6 +659,7 @@ def SetNodeParams(opts, args):
                                master_candidate=opts.master_candidate,
                                offline=opts.offline,
                                drained=opts.drained,
+                               master_capable=opts.master_capable,
                                force=opts.force,
                                auto_promote=opts.auto_promote)
 
@@ -710,7 +711,7 @@ commands = {
     (utils.CommaJoin(_LIST_HEADERS), utils.CommaJoin(_LIST_DEF_FIELDS))),
   'modify': (
     SetNodeParams, ARGS_ONE_NODE,
-    [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
+    [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT, CAPAB_MASTER_OPT,
      AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT],
     "<node_name>", "Alters the parameters of a node"),
   'powercycle': (
-- 
GitLab