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

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