cluster: RHEL55 - fencing: New option '--missing-as-off' to return OFF is machine is missing

Marek Grác marx at fedoraproject.org
Fri Nov 6 13:45:27 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=670629a1d944a4084258bca807d0152c246d2d4e
Commit:        670629a1d944a4084258bca807d0152c246d2d4e
Parent:        2d6c88823e2f2e663d4499769152cc0d21644d34
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Oct 19 15:28:23 2009 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Fri Nov 6 14:41:23 2009 +0100

fencing: New option '--missing-as-off' to return OFF is machine is missing

If a blade is not present (i.e. removed for maintenance), the fence_bladecenter
cannot check the state as it is reported empty.

Resolves: bz#248006
---
 fence/agents/bladecenter/fence_bladecenter.py |    7 +++++--
 fence/agents/lib/fencing.py.py                |    7 ++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index ef7ed53..ccb7436 100755
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -31,7 +31,10 @@ def get_power_status(conn, options):
 		i = conn.log_expect(options, [ node_cmd, "system>" ] , int(options["-Y"]))
 		if i == 1:
 			## Given blade number does not exist
-			fail(EC_STATUS)
+			if options.has_key("-M"):
+				return "off"
+			else:
+				fail(EC_STATUS)
 		conn.send("power -state\r\n")
 		conn.log_expect(options, node_cmd, int(options["-Y"]))
 		status = conn.before.splitlines()[-1]
@@ -93,7 +96,7 @@ def main():
 			"action", "ipaddr", "login", "passwd", "passwd_script",
 			"cmd_prompt", "secure", "port", "identity_file", "separator",
 			"inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
+			"power_timeout", "shell_timeout", "login_timeout", "power_wait", "missing_as_off" ]
 
 	atexit.register(atexit_handler)
 
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 19644c2..cb9bfde 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -341,7 +341,12 @@ all_opt = {
 		"longopt" : "power-wait",
 		"help" : "--power-wait <seconds>         Wait X seconds after issuing ON/OFF",
 		"default" : "0", 
-		"order" : 200 }
+		"order" : 200 },
+	"missing_as_off" : {
+		"getopt" : "M",
+		"longopt" : "missing-as-off",
+		"help" : "--missing-as-off               Missing port returns OFF instead of failure",
+		"order" : 200}
 }
 
 class fspawn(pexpect.spawn):


More information about the cluster-commits mailing list