Add master_capab to gnt-node modify
authorIustin Pop <iustin@google.com>
Tue, 26 Oct 2010 15:43:37 +0000 (17:43 +0200)
committerIustin Pop <iustin@google.com>
Wed, 27 Oct 2010 10:46:16 +0000 (12:46 +0200)
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
man/gnt-node.sgml
scripts/gnt-node

index 4575b05..a4c0de3 100644 (file)
@@ -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")
index 130718d..39e169f 100644 (file)
         <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>
         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>
index 3fa5ff9..645c543 100755 (executable)
@@ -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': (