[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/luci/site/luci/Extensions LuciClusterInf ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-09-21 16:06:52

Modified files:
	luci/site/luci/Extensions: LuciClusterInfo.py 
	luci/site/luci/Extensions/ClusterModel: FenceDeviceAttr.py 

Log message:
	Use cluster model builder calls to extract data instead of mucking directly with class members.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- conga/luci/site/luci/Extensions/LuciClusterInfo.py	2007/09/20 22:37:32	1.14
+++ conga/luci/site/luci/Extensions/LuciClusterInfo.py	2007/09/21 16:06:52	1.15
@@ -7,7 +7,6 @@
 
 from Products.Archetypes.utils import make_uuid
 from ClusterModel.ModelBuilder import ModelBuilder
-from ClusterModel.FenceDeviceAttr import FENCE_OPTS
 import RicciQueries as rq
 from ricci_communicator import RicciCommunicator
 from LuciSyslog import get_logger
@@ -655,7 +654,7 @@
 	clumap['device'] = ''
 	clumap['label'] = ''
 
-	# list struct for heuristics...
+	# list struct for heuristics
 	hlist = list()
 	if is_quorumd:
 		qdp = model.getQuorumdPtr()
@@ -1071,7 +1070,7 @@
 		if fencedev.getName().strip() == fencename:
 			fence_map = fencedev.getAttributes()
 			try:
-				fence_map['pretty_name'] = FENCE_OPTS[fencedev.getAgentType()]
+				fence_map['pretty_name'] = fencedev.getPrettyName()
 			except:
 				fence_map['unknown'] = True
 				fence_map['pretty_name'] = fencedev.getAgentType()
@@ -1182,7 +1181,7 @@
 					fencedev = {}
 
 					try:
-						fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+						fencedev['prettyname'] = fd.getPrettyName()
 					except:
 						fencedev['unknown'] = True
 						fencedev['prettyname'] = fd.getAgentType()
@@ -1230,7 +1229,7 @@
 						# a new fencedev struct
 						fencedev = {}
 						try:
-							fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+							fencedev['prettyname'] = fd.getPrettyName()
 						except:
 							fencedev['unknown'] = True
 							fencedev['prettyname'] = fd.getAgentType()
@@ -1274,7 +1273,7 @@
 				agentname = fd.getAgentType()
 				shared_struct['agent'] = agentname
 				try:
-					shared_struct['prettyname'] = FENCE_OPTS[agentname]
+					shared_struct['prettyname'] = fd.getPrettyName()
 				except:
 					shared_struct['unknown'] = True
 					shared_struct['prettyname'] = agentname
@@ -1298,7 +1297,7 @@
 				if fd.isShared() is False:	#Not a shared dev...build struct and add
 					fencedev = {}
 					try:
-						fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+						fencedev['prettyname'] = fd.getPrettyName()
 					except:
 						fencedev['unknown'] = True
 						fencedev['prettyname'] = fd.getAgentType()
@@ -1339,7 +1338,7 @@
 					else: #Shared, but not used above...so we need a new fencedev struct
 						fencedev = {}
 						try:
-							fencedev['prettyname'] = FENCE_OPTS[fd.getAgentType()]
+							fencedev['prettyname'] = fd.getPrettyName()
 						except:
 							fencedev['unknown'] = True
 							fencedev['prettyname'] = fd.getAgentType()
@@ -1382,7 +1381,7 @@
 				agentname = fd.getAgentType()
 				shared_struct['agent'] = agentname
 				try:
-					shared_struct['prettyname'] = FENCE_OPTS[agentname]
+					shared_struct['prettyname'] = fd.getPrettyName()
 				except:
 					shared_struct['unknown'] = True
 					shared_struct['prettyname'] = agentname
@@ -1420,7 +1419,7 @@
 			for kee in kees:
 				fencedev[kee] = attr_hash[kee] #copy attrs over
 			try:
-				fencedev['pretty_name'] = FENCE_OPTS[fd.getAgentType()]
+				fencedev['pretty_name'] = fd.getPrettyName()
 			except:
 				fencedev['unknown'] = True
 				fencedev['pretty_name'] = fd.getAgentType()
@@ -1484,10 +1483,8 @@
 		return vm_map
 
 	attrs = vm.getAttributes()
-	keys = attrs.keys()
-	for key in keys:
-		vm_map[key] = attrs[key]
-
+	if attrs:
+		vm_map.update(attrs)
 	return vm_map
 
 def getResourcesInfo(self, model, request):
--- conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py	2007/09/20 22:37:32	1.1
+++ conga/luci/site/luci/Extensions/ClusterModel/FenceDeviceAttr.py	2007/09/21 16:06:52	1.2
@@ -81,7 +81,7 @@
 	'fence_egenera':		[ 'lpan', 'pserver' ],
 	'fence_bullpap':		[ 'domain' ],
 	'fence_xvm':			[ 'domain' ],
-	'fence_scsi':			[ 'nodename' ],
+	'fence_scsi':			[ 'node' ],
 	'fence_ilo':			[ ],
 	'fence_ipmilan':		[ ],
 	'fence_drac':			[ ],


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]