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

[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2006-10-13 21:25:14

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	fix for zope brain damage that broke the fence device page

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.108&r2=1.109

--- conga/luci/cluster/form-macros	2006/10/13 21:01:59	1.83
+++ conga/luci/cluster/form-macros	2006/10/13 21:25:14	1.84
@@ -1972,7 +1972,7 @@
 		set_page_title('Luci — cluster — fence devices');
 	</script>
 	<h2>Shared Fence Devices for Cluster: <span tal:content="request/clustername"/></h2>
-  <tal:block tal:define="global fencedevinfo python: here.getFenceInfo(modelb)"/>
+  <tal:block tal:define="global fencedevinfo python: here.getFenceInfo(modelb, None)"/>
 <tal:block tal:define="global fencedevs python: fencedevinfo['fencedevs']"/>
   <span tal:repeat="fencedev fencedevs">
    <h3>Name: <span tal:content="fencedev/name"/></h3>
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/12 22:11:30	1.108
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/13 21:25:14	1.109
@@ -2117,7 +2117,7 @@
 
   return resultlist
 
-def getFenceInfo(self, model, request=None):
+def getFenceInfo(self, model, request):
   map = {}
   fencedevs = list() 
   level1 = list()
@@ -2924,6 +2924,35 @@
 	'smb': addSmb
 }
 
+def resolveClusterChanges(self, clusterName, modelb):
+	try:
+		mb_nodes = dict.fromkeys(modelb.getNodes())
+		if not mb_nodes or not len(mb_nodes):
+			raise
+		mb_map = {}
+		for i in iter(mb_nodes):
+			mb_map[i] = i
+	except:
+		return 'Unable to find cluster nodes for ' + clusterName
+
+	try:
+		cluster_node = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName)
+		if not cluster_node:
+			raise
+	except:
+		return 'Unable to find an entry for ' + clusterName + ' in the Luci database.'
+
+	try:
+		db_nodes = cluster_node.objectItems('Folder')
+		if not db_nodes or not len(db_nodes):
+			raise
+		db_map = {}
+		for i in iter(db_nodes):
+			db_map[i[0]] = i[0]
+	except:
+		# Should we just create them all? Can this even happen?
+		return 'Unable to find database entries for any nodes in ' + clusterName
+
 def addResource(self, request, ragent):
 	if not request.form:
 		return (False, {'errors': ['No form was submitted.']})


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