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

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Oct 16 15:18:32 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at sourceware.org	2006-10-16 15:18:32

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

Log message:
	bz# 206567

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.114&r2=1.115

--- conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/16 04:26:19	1.32
+++ conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/16 15:18:32	1.33
@@ -184,7 +184,7 @@
 	error = 'Unable to authenticate to the ricci agent on \"' + host + '\"'
 	return { 'host': host, 'ricci_host': systemName, 'prev_auth': False , 'cur_auth': False, 'errors': error, 'os': os_str }
 
-def validateAddClusterInitial(self, request):
+def validateAddClusterInitial(self, request, must_complete=True):
 	errors = list()
 	newNodeList = list()
 	nodeHash = {}
@@ -271,7 +271,10 @@
 		x['cur_auth'] - y['cur_auth'] or (('errors' in y) - ('errors' in x)) 
 	newNodeList.sort(sfn)
 
-	dfn = lambda x: not 'cur_auth' in x or x['cur_auth'] != True
+	if must_complete == True:
+		dfn = lambda x: not 'cur_auth' in x or x['cur_auth'] != True
+	else:
+		dfn = lambda x: False
 
 	cluster_properties = {
 		'clusterName': clusterName,
@@ -287,7 +290,7 @@
 	return (len(errors) < 1,
 		{'errors': errors, 'requestResults': cluster_properties })
 
-def validateAddCluster(self, request):
+def validateAddCluster(self, request, must_complete=True):
 	errors = list()
 	messages = list()
 	requestResults = None
@@ -392,7 +395,11 @@
 			oldNode['errors'] = True
 		i += 1
 
-	dfn = lambda x: not 'cur_auth' in x or x['cur_auth'] != True
+	if must_complete == True:
+		dfn = lambda x: not 'cur_auth' in x or x['cur_auth'] != True
+	else:
+		dfn = lambda x: False
+
 	clusterComplete = len(filter(dfn, nodeList)) == 0
 
 	if clusterComplete:
@@ -616,7 +623,11 @@
 		try: request.SESSION.set('checkRet', {})
 		except: pass
 		return homebasePortal(self, request, '.', '0')
-	ret = validatorFn(self, request)
+
+	if validatorFn == validateAddClusterInitial or validatorFn == validateAddCluster:
+		ret = validatorFn(self, request, must_complete=False)
+	else:
+		ret = validatorFn(self, request)
 	params = None
 
 	if 'params' in ret[1]:
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 05:27:59	1.114
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 15:18:32	1.115
@@ -1301,7 +1301,7 @@
 
 		if rc.authed():
 			return rc
-		setNodeFlag(node[1], CLUSTER_NODE_NEED_AUTH)
+		setNodeFlag(self, node[1], CLUSTER_NODE_NEED_AUTH)
 	return None
 
 def getRicciAgentForCluster(self, req):




More information about the Cluster-devel mailing list