cluster: RHEL59 - fence_apc: fence_apc fails for some port numbers

Marek GrĂ¡c marx at fedoraproject.org
Mon Jul 23 15:37:31 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=7d64a32254aac1c4bbeb7d7d684c606893d9fda1
Commit:        7d64a32254aac1c4bbeb7d7d684c606893d9fda1
Parent:        1ed8b72936fa7d871dbdc9b787e7e775d1ea3699
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Wed Jun 23 18:29:02 2010 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Mon Jul 23 17:20:28 2012 +0200

fence_apc: fence_apc fails for some port numbers

Problem is that string we parse looks like:
'Press Enter to continue ...\r 23-bar1 ON' and we did not expect text
message before our line.

Resolves: #606315
---
 fence/agents/apc/fence_apc.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
index 1aa7bed..0a3ce58 100755
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -71,11 +71,11 @@ def get_power_status(conn, options):
 		while True:
 			exp_result = conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], int(options["-Y"]))
 			lines = conn.before.split("\n");
-			show_re = re.compile('^\s*(\d+)- (.*?)\s+(ON|OFF)\s*')
+			show_re = re.compile('(^|\x0D)\s*(\d+)- (.*?)\s+(ON|OFF)\s*')
 			for x in lines:
 				res = show_re.search(x)
 				if (res != None):
-					outlets[res.group(1)] = (res.group(2), res.group(3))
+					outlets[res.group(2)] = (res.group(3), res.group(4))
 			conn.send("\r\n")
 			if exp_result == 0:
 				break


More information about the cluster-commits mailing list