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

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



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2006-10-11 16:18:58

Modified files:
	luci/site/luci/Extensions: cluster_adapters.py 
	                           homebase_adapters.py 

Log message:
	- robustness fixes for homebase
	- commit create cluster/add node backend param handler code

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.88&r2=1.89
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.24&r2=1.25

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/10 21:33:29	1.88
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/11 16:18:58	1.89
@@ -132,6 +132,22 @@
 	errors.extend(ret[0])
 	cluster_properties = ret[1]
 
+	rhn_dl = 1
+	try:
+		rhn_dls = request.form['rhn_dl'].strip().lower()
+		if rhn_dls != '1' and rhn_dls != 'true':
+			rhn_dl = 0
+	except:
+		rhn_dl = 0
+
+	enable_storage = 0
+	try:
+		enable_storage_str = request.form['enable_storage'].strip().lower()
+		if enable_storage_str:
+			enable_storage = 1
+	except:
+		enable_storage = 0
+
 	try:
 		nodeList = cluster_properties['nodeList']
 		if len(nodeList) < 1:
@@ -164,7 +180,7 @@
 					       map(lambda x: x['ricci_host'], nodeList),
 					       True,
 					       True,
-					       False,
+					       enable_storage,
 					       False)
 		if not batchNode:
 			nodeUnauth(nodeList)
@@ -231,6 +247,22 @@
 	else:
 		return (False, {'errors': [ 'Cluster name is missing'], 'requestResults': requestResults })
 
+	rhn_dl = 1
+	try:
+		rhn_dls = request.form['rhn_dl'].strip().lower()
+		if rhn_dls != '1' and rhn_dls != 'true':
+			rhn_dl = 0
+	except:
+		rhn_dl = 0
+
+	enable_storage = 0
+	try:
+		enable_storages = request.form['enable_storage'].strip().lower()
+		if enable_storages:
+			enable_storage = 1
+	except:
+		enable_storage = 0
+
 	try:
 		numStorage = int(request.form['numStorage'])
 		if numStorage < 1:
@@ -260,7 +292,7 @@
 			batchNode = addClusterNodeBatch(clusterName,
 							True,
 							True,
-							False,
+							enable_storage,
 							False)
 			if not batchNode:
 				raise
--- conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/06 20:45:26	1.24
+++ conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/11 16:18:58	1.25
@@ -450,7 +450,7 @@
 
 	userId = user.getUserId()
 
-	clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')()
+	clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')('Folder')
 	if not '__CLUSTER' in request.form:
 		for i in clusters:
 			try:
@@ -491,7 +491,7 @@
 				except:
 						errors.append('Failed to remove permission for ' + userId + ' for cluster ' + i[0])
 
-	storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')()
+	storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')('Folder')
 	if not '__SYSTEM' in request.form:
 		for i in storage:
 			try:
@@ -794,7 +794,7 @@
 
 def getClusterSystems(self, clusterName):
 	if isAdmin(self):
-		return self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName + '/objectItems')()
+		return self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName + '/objectItems')('Folder')
 
 	try:
 		i = getSecurityManager().getUser()
@@ -803,7 +803,7 @@
 	except:
 		return None
 
-	csystems = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName + '/objectItems')()
+	csystems = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName + '/objectItems')('Folder')
 	if not csystems:
 		return None
 
@@ -815,7 +815,7 @@
 
 def getClusters(self):
 	if isAdmin(self):
-		return self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')()
+		return self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')('Folder')
 	try:
 		i = getSecurityManager().getUser()
 		if not i:
@@ -823,7 +823,7 @@
 	except:
 		return None
 
-	clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')()
+	clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')('Folder')
 	if not clusters:
 		return None
 
@@ -836,7 +836,7 @@
 
 def getStorage(self):
 	if isAdmin(self):
-		return self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')()
+		return self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')('Folder')
 	try:
 		i = getSecurityManager().getUser()
 		if not i:
@@ -844,7 +844,7 @@
 	except:
 		return None
 
-	storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')()
+	storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')('Folder')
 	if not storage:
 		return None
 
@@ -1146,8 +1146,8 @@
 		perms[userName]['cluster'] = {}
 		perms[userName]['storage'] = {}
 
-		clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')()
-		storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')()
+		clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/objectItems')('Folder')
+		storage = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/objectItems')('Folder')
 
 		for c in clusters:
 			perms[userName]['cluster'][c[0]] = i.has_role('View', c[1])


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