Blame SOURCES/bz1780825-fencing-1-add-stonith_status_sleep.patch

af93a3
From b322891e91649d47656d63c73a0e08e9627f0b38 Mon Sep 17 00:00:00 2001
af93a3
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
af93a3
Date: Wed, 28 Apr 2021 12:20:07 +0200
af93a3
Subject: [PATCH] fencing: add stonith_status_sleep parameter for sleep between
af93a3
 status calls during a STONITH action
af93a3
af93a3
---
af93a3
 lib/fencing.py.py                             | 13 +++++++++++--
af93a3
 76 files changed, 386 insertions(+), 2 deletions(-)
af93a3
af93a3
diff --git a/lib/fencing.py.py b/lib/fencing.py.py
af93a3
index 9654f57be..bd7f529f7 100644
af93a3
--- a/lib/fencing.py.py
af93a3
+++ b/lib/fencing.py.py
af93a3
@@ -367,6 +367,14 @@
af93a3
 		"default" : "0",
af93a3
 		"required" : "0",
af93a3
 		"order" : 200},
af93a3
+	"stonith_status_sleep" : {
af93a3
+		"getopt" : ":",
af93a3
+		"longopt" : "stonith-status-sleep",
af93a3
+		"type" : "second",
af93a3
+		"help" : "--stonith-status-sleep=[seconds]   Sleep X seconds between status calls during a STONITH action",
af93a3
+		"default" : "1",
af93a3
+		"required" : "0",
af93a3
+		"order" : 200},
af93a3
 	"missing_as_off" : {
af93a3
 		"getopt" : "",
af93a3
 		"longopt" : "missing-as-off",
af93a3
@@ -478,7 +486,8 @@
af93a3
 		"default" : ["help", "debug", "verbose", "verbose_level",
af93a3
 			 "version", "action", "agent", "power_timeout",
af93a3
 			 "shell_timeout", "login_timeout", "disable_timeout",
af93a3
-			 "power_wait", "retry_on", "delay", "quiet"],
af93a3
+			 "power_wait", "stonith_status_sleep", "retry_on", "delay",
af93a3
+			 "quiet"],
af93a3
 		"passwd" : ["passwd_script"],
af93a3
 		"sudo" : ["sudo_path"],
af93a3
 		"secure" : ["identity_file", "ssh_options", "ssh_path", "inet4_only", "inet6_only"],
af93a3
@@ -828,7 +837,7 @@ def async_set_multi_power_fn(connection, options, set_power_fn, get_power_fn, re
af93a3
 
af93a3
 		for _ in itertools.count(1):
af93a3
 			if get_multi_power_fn(connection, options, get_power_fn) != options["--action"]:
af93a3
-				time.sleep(1)
af93a3
+				time.sleep(int(options["--stonith-status-sleep"]))
af93a3
 			else:
af93a3
 				return True