cluster: RHEL59 - fence agents: Using "delay" option can ends with timeout problems

Marek GrĂ¡c marx at fedoraproject.org
Thu Apr 12 08:12:26 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=de6fa9a06f0ef100edb092342b1466bac3466e70
Commit:        de6fa9a06f0ef100edb092342b1466bac3466e70
Parent:        4b3a6a1103b3f83b1f5d34e0aef387c396126eca
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Mar 19 16:45:23 2012 +0100
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Apr 12 09:43:16 2012 +0200

fence agents: Using "delay" option can ends with timeout problems

Resolves: rhbz#804170
---
 fence/agents/lib/fencing.py.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 1ff51a4..c4fe218 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -782,8 +782,6 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
 				print o + options["-C"] + alias	
 		return
 
-	if options["-o"] in ["off", "reboot"]:
-		time.sleep(int(options["-f"]))
 	status = get_power_fn(tn, options)
 
 	if status != "on" and status != "off":  
@@ -866,6 +864,11 @@ def fence_login(options):
 	else:
 		login_eol = "\r\n"
 
+	## Do the delay of the fence device before logging in
+	## Delay is important for two-node clusters fencing but we do not need to delay 'status' operations
+	if options["-o"] in ["off", "reboot"]:
+		time.sleep(int(options["-f"]))
+
 	try:
 		re_login = re.compile("(login\s*: )|(Login Name:  )|(username: )|(User Name :)", re.IGNORECASE)
 		re_pass  = re.compile("password", re.IGNORECASE)


More information about the cluster-commits mailing list