Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 893b4547bb5f5eb61d2f3af4281e5a38 > files > 90

cman-2.0.115-96.el5_8.1.src.rpm

From 2aee9d63481c3327150f5f68d2293972b6208b94 Mon Sep 17 00:00:00 2001
From: Marek 'marx' Grac <mgrac@redhat.com>
Date: Wed, 11 Nov 2009 14:24:05 +0100
Subject: [PATCH] fencing: Invalid initialization of default value for retry-on option

Problem introduced by:

commit 45ed9fd03c0718252f2ae418ffa7161198aa4688
Author: Marek 'marx' Grac <mgrac@redhat.com>
Date:   Fri Nov 6 14:13:02 2009 +0100

    fencing: New option --retry-on <N>
---
 fence/agents/ilo/fence_ilo.py  |    3 +--
 fence/agents/lib/fencing.py.py |   11 ++++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py
index f0c7165..10d888c 100755
--- a/fence/agents/ilo/fence_ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -56,8 +56,7 @@ def main():
 	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
 			"action", "ipaddr", "login", "passwd", "passwd_script",
 			"ssl", "ribcl", "inet4_only", "inet6_only", "ipport",
-			"power_timeout", "shell_timeout", "login_timeout", "power_wait",
-			"retry_on" ]
+			"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
 
 	atexit.register(atexit_handler)
 
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index fb87b13..a71f903 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -349,7 +349,7 @@ all_opt = {
 		"help" : "--missing-as-off               Missing port returns OFF instead of failure",
 		"order" : 200 },
 	"retry_on" : {
-		"getopt" : "r:",
+		"getopt" : "F:",
 		"longopt" : "retry-on",
 		"help" : "--retry-on <attempts>          Count of attempts to retry power on",
 		"default" : "1",
@@ -566,6 +566,11 @@ def process_input(avail_opt):
 def check_input(device_opt, opt):
 	global all_opt
 
+	##
+	## Add options which are available for every fence agent
+	#####
+	device_opt.append("retry_on")
+	
 	options = dict(opt)
 	options["device_opt"] = device_opt
 
@@ -722,7 +727,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["-r"])):
+			for i in range(1,int(options["-F"])):
 				set_power_fn(tn, options)
 				time.sleep(int(options["-G"]))
 				if wait_power_status(tn, options, get_power_fn):
@@ -753,7 +758,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["-r"])):
+		for i in range(1,int(options["-F"])):
 			set_power_fn(tn, options)
 			time.sleep(int(options["-G"]))
 			if wait_power_status(tn, options, get_power_fn) == 1:
-- 
1.6.0.6