Blame SOURCES/bz1259319-fence_apc_v6.patch

44709c
From ea8cc4949d562b75822d9362808cf3d333fb6d92 Mon Sep 17 00:00:00 2001
44709c
From: Marek 'marx' Grac <mgrac@redhat.com>
44709c
Date: Mon, 14 Sep 2015 13:27:45 +0200
44709c
Subject: [PATCH] fence_apc: Support for v6.x firmware
44709c
44709c
There are no changes in interface, so it is enough to accept new version number.
44709c
Login process over telnet has changed a bit and autodection of EOL did not work properly. Relevant part
44709c
of changed so it work correctly when after empty 'User Name', the device ask for it again.
44709c
44709c
Resolves: rhbz#1259319
44709c
---
44709c
 fence/agents/apc/fence_apc.py  | 2 +-
44709c
 fence/agents/lib/fencing.py.py | 2 +-
44709c
 2 files changed, 2 insertions(+), 2 deletions(-)
44709c
44709c
diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
44709c
index 83bfe07..b77d36e 100644
44709c
--- a/fence/agents/apc/fence_apc.py
44709c
+++ b/fence/agents/apc/fence_apc.py
44709c
@@ -247,7 +247,7 @@ will block any necessary fencing actions."
44709c
 	####
44709c
 	result = -1
44709c
 	firmware_version = re.compile(r'\s*v(\d)*\.').search(conn.before)
44709c
-	if (firmware_version != None) and (firmware_version.group(1) == "5"):
44709c
+	if (firmware_version != None) and (firmware_version.group(1) in [ "5", "6" ]):
44709c
 		result = fence_action(conn, options, set_power_status5, get_power_status5, get_power_status5)
44709c
 	else:
44709c
 		result = fence_action(conn, options, set_power_status, get_power_status, get_power_status)
44709c
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
44709c
index 7fddc47..fe602a5 100644
44709c
--- a/fence/agents/lib/fencing.py.py
44709c
+++ b/fence/agents/lib/fencing.py.py
44709c
@@ -1153,7 +1153,7 @@ def fence_login(options, re_login_string=r"(login\s*: )|(Login Name:  )|(usernam
44709c
 					conn.send_eol("")
44709c
 					screen = conn.read_nonblocking(size=100, timeout=int(options["--shell-timeout"]))
44709c
 					## after sending EOL the fence device can either show 'Login' or 'Password'
44709c
-					if re_login.search(screen) != None:
44709c
+					if re_login.search(conn.after + screen) != None:
44709c
 						conn.send_eol("")
44709c
 					conn.send_eol(options["--username"])
44709c
 					conn.log_expect(options, re_pass, int(options["--login-timeout"]))
44709c
-- 
44709c
2.4.3
44709c