diff --git a/SOURCES/bz1470813-fencing-3-make-timeout-0-mean-forever.patch b/SOURCES/bz1470813-fencing-3-make-timeout-0-mean-forever.patch new file mode 100644 index 0000000..9445561 --- /dev/null +++ b/SOURCES/bz1470813-fencing-3-make-timeout-0-mean-forever.patch @@ -0,0 +1,38 @@ +From 4cf6887e98c712b99f741dbfe54932c60e93741b Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 3 Nov 2020 14:30:12 +0100 +Subject: [PATCH] fencing: fix to make timeout(s)=0 be treated as forever for + agents using pexpect + +--- + lib/fencing.py.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/lib/fencing.py.py b/lib/fencing.py.py +index 4639a9a5..fa34f13a 100644 +--- a/lib/fencing.py.py ++++ b/lib/fencing.py.py +@@ -500,10 +500,13 @@ def __init__(self, options, command, **kwargs): + self.opt = options + + def log_expect(self, pattern, timeout): +- result = self.expect(pattern, timeout) ++ result = self.expect(pattern, timeout if timeout != 0 else None) + logging.debug("Received: %s", self.before + self.after) + return result + ++ def read_nonblocking(self, size, timeout): ++ return pexpect.spawn.read_nonblocking(self, size=100, timeout=timeout if timeout != 0 else None) ++ + def send(self, message): + logging.debug("Sent: %s", message) + return pexpect.spawn.send(self, message) +@@ -516,7 +519,7 @@ def frun(command, timeout=30, withexitstatus=False, events=None, + extra_args=None, logfile=None, cwd=None, env=None, **kwargs): + if sys.version_info[0] > 2: + kwargs.setdefault('encoding', 'utf-8') +- return pexpect.run(command, timeout=timeout, ++ return pexpect.run(command, timeout=timeout if timeout != 0 else None, + withexitstatus=withexitstatus, events=events, + extra_args=extra_args, logfile=logfile, cwd=cwd, + env=env, **kwargs) diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 55373da..f91991e 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -29,7 +29,7 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.2.1 -Release: 57%{?alphatag:.%{alphatag}}%{?dist} +Release: 58%{?alphatag:.%{alphatag}}%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -116,6 +116,7 @@ Patch74: bz1853973-fence_ipmilan-allow-increasing-ipmitool-verbosity.patch Patch75: bz1861926-fence_lpar-fix-list-status-action.patch Patch76: bz1470813-fencing-1-disable-timeout.patch Patch77: bz1470813-fencing-2-fix-power-timeout.patch +Patch78: bz1470813-fencing-3-make-timeout-0-mean-forever.patch %if 0%{?fedora} || 0%{?rhel} > 7 %global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hds_cb hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti @@ -271,6 +272,7 @@ BuildRequires: python3-google-api-client %patch75 -p1 %patch76 -p1 %patch77 -p1 +%patch78 -p1 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -1159,7 +1161,7 @@ Fence agent for IBM z/VM over IP. %endif %changelog -* Thu Oct 15 2020 Oyvind Albrigtsen - 4.2.1-57 +* Tue Nov 3 2020 Oyvind Albrigtsen - 4.2.1-58 - fencing: add disable-timeout parameter and make it true by default for Pacemaker 2.0+ Resolves: rhbz#1470813, rhbz#1436429