Blame SOURCES/bz1977588-4-fence_kubevirt-power-timeout-40s.patch

021bc5
From a3d8ce78ed5687954847560f77daafe6474de33f Mon Sep 17 00:00:00 2001
021bc5
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
021bc5
Date: Tue, 2 Nov 2021 09:44:33 +0100
021bc5
Subject: [PATCH] fence_kubevirt: set default power-timeout to 40s
021bc5
021bc5
---
021bc5
 agents/kubevirt/fence_kubevirt.py      | 6 ++++++
021bc5
 tests/data/metadata/fence_kubevirt.xml | 2 +-
021bc5
 2 files changed, 7 insertions(+), 1 deletion(-)
021bc5
021bc5
diff --git a/agents/kubevirt/fence_kubevirt.py b/agents/kubevirt/fence_kubevirt.py
021bc5
index 61ffcaa09..8392b75a0 100755
021bc5
--- a/agents/kubevirt/fence_kubevirt.py
021bc5
+++ b/agents/kubevirt/fence_kubevirt.py
021bc5
@@ -2,6 +2,7 @@
021bc5
 
021bc5
 import sys
021bc5
 import logging
021bc5
+import atexit
021bc5
 sys.path.append("@FENCEAGENTSLIBDIR@")
021bc5
 from fencing import *
021bc5
 from fencing import fail, fail_usage, run_delay, EC_STATUS, EC_FETCH_VM_UUID
021bc5
@@ -110,7 +111,12 @@ def main():
021bc5
     conn = None
021bc5
 
021bc5
     device_opt = ["port", "namespace", "kubeconfig", "ssl_insecure", "no_password", "apiversion"]
021bc5
+
021bc5
+    atexit.register(atexit_handler)
021bc5
     define_new_opts()
021bc5
+
021bc5
+    all_opt["power_timeout"]["default"] = "40"
021bc5
+
021bc5
     options = check_input(device_opt, process_input(device_opt))
021bc5
 
021bc5
     docs = {}