fence-agents: master - fencing: New option '--missing-as-off' to return OFF is machine is missing
Marek Grác
marx at fedoraproject.org
Wed Oct 14 13:06:39 UTC 2009
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=460609f46485cd39f1ea158a00e1ca8fa3dd809f
Commit: 460609f46485cd39f1ea158a00e1ca8fa3dd809f
Parent: 5ef43e753c65d117fab964f0fb58f47b84ec78d6
Author: Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate: Wed Oct 14 13:59:13 2009 +0200
Committer: Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Wed Oct 14 13:59:13 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 87819e4..d55f31a 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 fe83a3f..9df1190 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