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

Marek Grác marx at fedoraproject.org
Mon Oct 19 13:28:45 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0bb947f3c9447879551eea0a79e61e026abc5972
Commit:        0bb947f3c9447879551eea0a79e61e026abc5972
Parent:        a7ef8c12f7b09769f03294b1f6d0df02aba96735
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: Mon Oct 19 15:28:23 2009 +0200

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 0e4ea84..414c260 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -30,7 +30,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]
@@ -92,7 +95,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 627e988..566cebf 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -342,7 +342,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