From dd94e9f63f6200172a4cbf3b835679ee55f4bc66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Thu, 16 Dec 2010 15:19:06 +0100
Subject: [PATCH] gnt-node modify: Adding --node-powered=yes|no
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/cli.py             | 1 +
 lib/client/gnt_node.py | 6 ++++--
 man/gnt-node.rst       | 4 ++++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index 77ebfcb74..25e3d7690 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -108,6 +108,7 @@ __all__ = [
   "NODE_PLACEMENT_OPT",
   "NODEGROUP_OPT",
   "NODE_PARAMS_OPT",
+  "NODE_POWERED_OPT",
   "NODRBD_STORAGE_OPT",
   "NOHDR_OPT",
   "NOIPCHECK_OPT",
diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py
index ee712585b..24a9b25e0 100644
--- a/lib/client/gnt_node.py
+++ b/lib/client/gnt_node.py
@@ -680,7 +680,8 @@ def SetNodeParams(opts, args):
                                secondary_ip=opts.secondary_ip,
                                force=opts.force,
                                ndparams=opts.ndparams,
-                               auto_promote=opts.auto_promote)
+                               auto_promote=opts.auto_promote,
+                               powered=opts.node_powered)
 
   # even if here we process the result, we allow submit only
   result = SubmitOrSend(op, opts)
@@ -739,7 +740,8 @@ commands = {
     SetNodeParams, ARGS_ONE_NODE,
     [FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
      CAPAB_MASTER_OPT, CAPAB_VM_OPT, SECONDARY_IP_OPT,
-     AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT],
+     AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT, NODE_PARAMS_OPT,
+     NODE_POWERED_OPT],
     "<node_name>", "Alters the parameters of a node"),
   'powercycle': (
     PowercycleNode, ARGS_ONE_NODE,
diff --git a/man/gnt-node.rst b/man/gnt-node.rst
index da5722f7c..01b4e72dd 100644
--- a/man/gnt-node.rst
+++ b/man/gnt-node.rst
@@ -354,6 +354,7 @@ MODIFY
 | [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote]
 | [-s *secondary_ip*]
 | [--node-parameters *ndparams*]
+| [--node-powered=``yes|no``]
 | {*node*}
 
 This command changes the role of the node. Each options takes
@@ -361,6 +362,9 @@ either a literal yes or no, and only one option should be given as
 yes. The meaning of the roles and flags are described in the
 manpage **ganeti**(7).
 
+``--node-powered`` can be used to modify state-of-record if it doesn't reflect
+the reality anymore.
+
 In case a node is demoted from the master candidate role, the
 operation will be refused unless you pass the ``--auto-promote``
 option. This option will cause the operation to lock all cluster nodes
-- 
GitLab