Blame SOURCES/bz1342584-fence_apc-fix-connection-timed-out.patch

e4ffb1
diff -uNr a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
e4ffb1
--- a/fence/agents/apc/fence_apc.py	2016-06-17 12:39:29.677024556 +0200
e4ffb1
+++ b/fence/agents/apc/fence_apc.py	2016-06-17 12:58:58.234215019 +0200
e4ffb1
@@ -14,7 +14,7 @@
e4ffb1
 ##        cipher (des/blowfish) have to be defined
e4ffb1
 #####
e4ffb1
 
e4ffb1
-import sys, re
e4ffb1
+import sys, re, time
e4ffb1
 import atexit
e4ffb1
 sys.path.append("@FENCEAGENTSLIBDIR@")
e4ffb1
 from fencing import *
e4ffb1
@@ -26,6 +26,10 @@
e4ffb1
 BUILD_DATE="March, 2008"
e4ffb1
 #END_VERSION_GENERATION
e4ffb1
 
e4ffb1
+# Fix for connection timed out issue in:
e4ffb1
+# https://bugzilla.redhat.com/show_bug.cgi?id=1342584
e4ffb1
+TIMEDOUT_DELAY = 0.5
e4ffb1
+
e4ffb1
 def get_power_status(conn, options):
e4ffb1
 	exp_result = 0
e4ffb1
 	outlets = {}
e4ffb1
@@ -78,6 +82,7 @@
e4ffb1
 			res = show_re.search(line)
e4ffb1
 			if res != None:
e4ffb1
 				outlets[res.group(2)] = (res.group(3), res.group(4))
e4ffb1
+		time.sleep(TIMEDOUT_DELAY)
e4ffb1
 		conn.send_eol("")
e4ffb1
 		if exp_result != 0:
e4ffb1
 			break
e4ffb1
@@ -151,6 +156,7 @@
e4ffb1
 
e4ffb1
 	while 0 == conn.log_expect(options,
e4ffb1
 			["Press <ENTER>"] + options["--command-prompt"], int(options["--shell-timeout"])):
e4ffb1
+		time.sleep(TIMEDOUT_DELAY)
e4ffb1
 		conn.send_eol("")
e4ffb1
 
e4ffb1
 	conn.send_eol(options["--plug"]+"")
e4ffb1
@@ -171,6 +177,7 @@
e4ffb1
 	conn.log_expect(options, "Enter 'YES' to continue or <ENTER> to cancel :", int(options["--shell-timeout"]))
e4ffb1
 	conn.send_eol("YES")
e4ffb1
 	conn.log_expect(options, "Press <ENTER> to continue...", int(options["--shell-timeout"]))
e4ffb1
+	time.sleep(TIMEDOUT_DELAY)
e4ffb1
 	conn.send_eol("")
e4ffb1
 	conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
e4ffb1
 	conn.send(chr(03))