fence-agents: master - fencing: Unable to power on machine after applying patch
Marek Grác
marx at fedoraproject.org
Wed Nov 11 14:03:08 UTC 2009
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=5215e29266b95f1492428b296e7232c7afe1237a
Commit: 5215e29266b95f1492428b296e7232c7afe1237a
Parent: eb7ec25c753af56d54dbf62da22206ce3c19ddf4
Author: Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate: Wed Nov 11 15:01:19 2009 +0100
Committer: Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Wed Nov 11 15:01:19 2009 +0100
fencing: Unable to power on machine after applying patch
Problem introduced by:
commit 45ed9fd03c0718252f2ae418ffa7161198aa4688
Author: Marek 'marx' Grac <mgrac at redhat.com>
Date: Fri Nov 6 14:13:02 2009 +0100
fencing: New option --retry-on <N>
---
fence/agents/lib/fencing.py.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 4aa3224..d37498f 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -356,6 +356,8 @@ all_opt = {
"order" : 200 }
}
+common_opt = [ "retry_on" ]
+
class fspawn(pexpect.spawn):
def log_expect(self, options, pattern, timeout):
result = self.expect(pattern, timeout)
@@ -466,6 +468,12 @@ def metadata(avail_opt, options, docs):
def process_input(avail_opt):
global all_opt
+ global common_opt
+
+ ##
+ ## Add options which are available for every fence agent
+ #####
+ avail_opt.extend(common_opt)
##
## Set standard environment
@@ -565,11 +573,12 @@ def process_input(avail_opt):
######
def check_input(device_opt, opt):
global all_opt
+ global common_opt
##
## Add options which are available for every fence agent
#####
- device_opt.append("retry_on")
+ device_opt.extend(common_opt)
options = dict(opt)
options["device_opt"] = device_opt
@@ -727,7 +736,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
print "Success: Already ON"
else:
power_on = False
- for i in range(1,int(options["-F"])):
+ for i in range(1,1 + int(options["-F"])):
set_power_fn(tn, options)
time.sleep(int(options["-G"]))
if wait_power_status(tn, options, get_power_fn):
@@ -758,7 +767,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
options["-o"] = "on"
power_on = False
- for i in range(1,int(options["-F"])):
+ for i in range(1,1 + int(options["-F"])):
set_power_fn(tn, options)
time.sleep(int(options["-G"]))
if wait_power_status(tn, options, get_power_fn) == 1:
More information about the cluster-commits
mailing list