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

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