cluster: RHEL58 - fence_bladecenter: Reboot operation did not work correctly with --missing-as-off

Marek Grác marx at fedoraproject.org
Thu Sep 15 08:56:59 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=beb2677e0fd466058c3afb12de091d864a1e6126
Commit:        beb2677e0fd466058c3afb12de091d864a1e6126
Parent:        6689362008847088660603c7a041968fb33b50be
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Thu May 26 18:00:54 2011 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Sep 15 10:48:59 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 b4f7eb9..ac65f65 100755
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -57,7 +57,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")


More information about the cluster-commits mailing list