cluster: RHEL58 - fence_drac5: Fix support for Dell DRAC CMC

Marek Grác marx at fedoraproject.org
Thu Sep 15 08:57:02 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a322f4f709a1ac80a8cfb8b2a4c66aea5cd27a66
Commit:        a322f4f709a1ac80a8cfb8b2a4c66aea5cd27a66
Parent:        beb2677e0fd466058c3afb12de091d864a1e6126
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Fri Jul 1 13:10:37 2011 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Sep 15 10:49:42 2011 +0200

fence_drac5: Fix support for Dell DRAC CMC

Fix operation 'list' for Drac CMC and typo that causes python traceback

Resolves: rhbz#718194
---
 fence/agents/drac/fence_drac5.py |    4 ++--
 fence/agents/lib/fencing.py.py   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py
index ab02b21..a1398b1 100755
--- a/fence/agents/drac/fence_drac5.py
+++ b/fence/agents/drac/fence_drac5.py
@@ -66,10 +66,10 @@ def get_list_devices(conn, options):
 			conn.sendline("getmodinfo")
 
 			list_re = re.compile("^([^\s]*?)\s+Present\s*(ON|OFF)\s*.*$")
+			conn.log_expect(options, options["-c"], int(options["-g"]))
 			for line in conn.before.splitlines():
 				if (list_re.search(line)):
 					outlets[list_re.search(line).group(1)] = ("", list_re.search(line).group(2))
-			conn.log_expect(options, options["-c"], int(options["-g"]))
 		elif options["model"] == "DRAC 5":
 			## DRAC 5 can be used only for one computer
 			pass
@@ -113,7 +113,7 @@ By default, the telnet interface is not  enabled."
 	conn = fence_login(options)
 
 	if conn.before.find("CMC") >= 0:
-		if 0 == options.has_key("-m") and 0 == ["monitor", "list"].count(option["-o"].lower()):
+		if 0 == options.has_key("-m") and 0 == ["monitor", "list"].count(options["-o"].lower()):
 			fail_usage("Failed: You have to enter module name (-m)")
 			
 		options["model"]="DRAC CMC"		
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 61c23af..1ff51a4 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -764,7 +764,7 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None
 	
 	## Process options that manipulate fencing device
 	#####
-	if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition") and 0 == options["device_opt"].count("uuid")):
+	if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition") and 0 == options["device_opt"].count("uuid") and 0 == options["device_opt"].count("module_name")):
 		print "N/A"
 		return
 	elif (options["-o"] == "list" and get_outlet_list == None):


More information about the cluster-commits mailing list