Blame SOURCES/bz1259319-fence_apc_v6.patch

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