fence-agents: master - fence_drac5: Fix regression on Dell CMC and Dell DRAC5

Marek GrĂ¡c marx at fedoraproject.org
Tue Jan 29 14:26:57 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=4bd62484e17cc63b27a103c744ec11fb00610b48
Commit:        4bd62484e17cc63b27a103c744ec11fb00610b48
Parent:        81f9d0ac95b57791b5937ea96fac889e10782d53
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Tue Jan 29 15:24:20 2013 +0100
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Tue Jan 29 15:24:20 2013 +0100

fence_drac5: Fix regression on Dell CMC and Dell DRAC5

Standard EOL for agents connecting via ssh is CR/LF.
Some Dell devices represents CR/LF as double-enter what creates a problem in parsing of output.

This patch adds a check for double-enter. This can be detected in function which power on/off machine
because 'get power status' was run before and if we can find a line without any command we know that
there is a double-enter problem.

Resolves: rhbz#904195

Resolves: rhbz#904195
---
 fence/agents/drac5/fence_drac5.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index 09157fe..3ec354e 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -46,7 +46,14 @@ def set_power_status(conn, options):
 		conn.send_eol("racadm serveraction " + action + " -m " + options["--module-name"])
 	elif options["model"] == "DRAC 5":
 		conn.send_eol("racadm serveraction " + action)
+
+	## Fix issue with double-enter [CR/LF]
+	##	We need to read two additional command prompts (one from get + one from set command)
 	conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+	if len(conn.before.strip()) == 0:
+		options["eol"] = options["eol"][:-1]
+		conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
+		conn.log_expect(options, options["--command-prompt"], int(options["--power-timeout"]))
 
 def get_list_devices(conn, options):
 	outlets = { }


More information about the cluster-commits mailing list