summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek 'marx' Grac <mgrac@redhat.com>2013-01-29 14:24:20 (GMT)
committerMarek 'marx' Grac <mgrac@redhat.com>2013-01-29 14:24:20 (GMT)
commit4bd62484e17cc63b27a103c744ec11fb00610b48 (patch)
tree31b0ec38c474d0daa528327a25b794a41b55a703
parent81f9d0ac95b57791b5937ea96fac889e10782d53 (diff)
downloadfence-agents-4bd62484e17cc63b27a103c744ec11fb00610b48.zip
fence-agents-4bd62484e17cc63b27a103c744ec11fb00610b48.tar.gz
fence-agents-4bd62484e17cc63b27a103c744ec11fb00610b48.tar.xz
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
-rw-r--r--fence/agents/drac5/fence_drac5.py7
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 = { }