From fcecea0b1f9c3a9894d9a03a6b07f16c50fb64d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Tue, 8 Mar 2011 11:34:15 +0100
Subject: [PATCH] gnt-cluster epo: Adding --shutdown-timeout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This adds the --shutdown-timeout flag to gnt-cluster epo to specify the
shutdown timeout for instance shutdown.

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/client/gnt_cluster.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index f83f894e9..c6a2aba79 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -949,7 +949,8 @@ def _InstanceStart(opts, inst_list, start):
     opcls = opcodes.OpInstanceStartup
     text_submit, text_success, text_failed = ("startup", "started", "starting")
   else:
-    opcls = opcodes.OpInstanceShutdown
+    opcls = compat.partial(opcodes.OpInstanceShutdown,
+                           timeout=opts.shutdown_timeout)
     text_submit, text_success, text_failed = ("shutdown", "stopped", "stopping")
 
   jex = JobExecutor(opts=opts)
@@ -1312,7 +1313,8 @@ commands = {
     "Renews cluster certificates, keys and secrets"),
   "epo": (
     Epo, [ArgUnknown()],
-    [FORCE_OPT, ON_OPT, GROUPS_OPT, ALL_OPT, OOB_TIMEOUT_OPT],
+    [FORCE_OPT, ON_OPT, GROUPS_OPT, ALL_OPT, OOB_TIMEOUT_OPT,
+     SHUTDOWN_TIMEOUT_OPT],
     "[opts...] [args]",
     "Performs an emergency power-off on given args"),
   }
-- 
GitLab