diff options
authorMarek 'marx' Grac <>2013-01-29 14:24:20 (GMT)
committerMarek 'marx' Grac <>2013-01-29 14:24:20 (GMT)
commit4bd62484e17cc63b27a103c744ec11fb00610b48 (patch)
parent81f9d0ac95b57791b5937ea96fac889e10782d53 (diff)
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
1 files changed, 7 insertions, 0 deletions
diff --git a/fence/agents/drac5/ b/fence/agents/drac5/
index 09157fe..3ec354e 100644
--- a/fence/agents/drac5/
+++ b/fence/agents/drac5/
@@ -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 = { }