Gitweb:
http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 154e89e617ee77600e8e56604bad92ae73cb70fe
Parent: d179778bce4f4f533e9aa9d9da9b3997b59dba70
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu May 26 18:00:54 2011 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jul 1 13:26:51 2011 +0200
fence_bladecenter: Reboot operation did not work correctly with --missing-as-off
This patch adds a correct handling of situation where prompt was not changed
as expected (means blade is not available)
Resolves: rhbz#689851
---
fence/agents/bladecenter/fence_bladecenter.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/fence/agents/bladecenter/fence_bladecenter.py
b/fence/agents/bladecenter/fence_bladecenter.py
index 8b890e4..c699b75 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -56,7 +56,14 @@ def set_power_status(conn, options):
node_cmd = "system:blade\[" + options["-n"] + "\]>"
conn.send("env -T system:blade[" + options["-n"] +
"]\r\n")
- conn.log_expect(options, node_cmd, int(options["-Y"]))
+ i = conn.log_expect(options, [ node_cmd, "system>" ] ,
int(options["-Y"]))
+ if i == 1:
+ ## Given blade number does not exist
+ if options.has_key("-M"):
+ return
+ else:
+ fail(EC_GENERIC_ERROR)
+
conn.send("power -"+options["-o"]+"\r\n")
conn.log_expect(options, node_cmd, int(options["-Y"]))
conn.send("env -T system\r\n")