commit 154e89e617ee77600e8e56604bad92ae73cb70fe Author: Marek 'marx' Grac <mgrac@redhat.com> Date: Thu May 26 18:00:54 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 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")