[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-07-31 18:21:52

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

Log message:
	fix call to buildClusterCreateFlags and send cluster name to validatation routines

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

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/07/31 17:46:32	1.24
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/07/31 18:21:52	1.25
@@ -25,7 +25,7 @@
 
 CLUSTER_FOLDER_PATH = '/luci/systems/cluster/'
 
-def validateClusterNodes(request, sessionData, numStorage):
+def validateClusterNodes(request, sessionData, clusterName, numStorage):
 	nodeList = list()
 	nodeHash = {}
 	rnodeHash = {}
@@ -118,7 +118,7 @@
 	if numStorage < 2:
 		return (False, { 'errors': ['A cluster must contain at least two nodes'], 'requestResults': requestResults })
 
-	ret = validateClusterNodes(request, sessionData, numStorage)
+	ret = validateClusterNodes(request, sessionData, clusterName, numStorage)
 	errors.extend(ret[0])
 	cluster_properties = ret[1]
 
@@ -154,14 +154,14 @@
 			try:
 				rc = RicciCommunicator(i['ricci_host'])
 				resultNode = rc.process_batch(batchNode, async=True)
-                                batch_id_map[i['ricci_host']] = resultNode.getAttribute('batch_id')
+				batch_id_map[i['ricci_host']] = resultNode.getAttribute('batch_id')
 			except:
 				nodeUnauth(nodeList)
 				cluster_properties['isComplete'] = False
 				errors.append('An error occurred while attempting to add cluster node \"' + i['ricci_host'] + '\"')
 				return (False, {'errors': errors, 'requestResults':cluster_properties })
 
-                buildClusterCreateFlags(batch_id_map, clusterName)
+		buildClusterCreateFlags(self, batch_id_map, clusterName)
 
 	messages.append('Creation of cluster \"' + clusterName + '\" has begun')
 	return (True, {'errors': errors, 'messages': messages })
@@ -204,7 +204,7 @@
 		errors.append('You must specify at least one node to add to the cluster')
 		return (False, {'errors': [ errors ] })
 
-	ret = validateClusterNodes(sessionData, request, numStorage)
+	ret = validateClusterNodes(sessionData, request, clusterName, numStorage)
 	errors.extend(ret[0])
 	cluster_properties = ret[1]
 
@@ -849,6 +849,10 @@
   rb = ricci_bridge(ricci_name)
   doc = rb.getClusterStatus()
   results = list()
+
+  if not doc or not doc.firstChild:
+    return {}
+
   vals = {}
   vals['type'] = "cluster"
   try:
@@ -1213,7 +1217,8 @@
       clulist.append(item)
     else:
       continue
-
+  if len(clulist) < 1:
+    return {}
   clu = clulist[0]
   clustername = clu['name']
   if clu['alias'] != "":


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