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

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Feb 12 20:25:42 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-02-12 20:25:42

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

Log message:
	- A handful of fixes for bugs that show up when unlikely exceptions are raised
	- Fix for a bug that could cause luci to fail to try to authenticate to ricci agents

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.227.2.5&r2=1.227.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.48.2.1&r2=1.48.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.24&r2=1.24.2.1

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/08 15:59:20	1.227.2.5
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/12 20:25:42	1.227.2.6
@@ -323,7 +323,9 @@
 		try:
 			resultNode = rc.process_batch(batchNode, async=True)
 			batch_id_map[i] = resultNode.getAttribute('batch_id')
-		except:
+		except Exception, e:
+			luci_log.debug_verbose('validateCreateCluster0: %s: %s' \
+				% (i, str(e)))
 			errors.append('An error occurred while attempting to add cluster node \"%s\"' % i)
 			if len(batch_id_map) == 0:
 				request.SESSION.set('create_cluster', add_cluster)
@@ -448,6 +450,7 @@
 
 			prev_auth = rc.authed()
 			cur_system['prev_auth'] = prev_auth
+
 			try:
 				if prev_auth:
 					messages.append('Host %s is already authenticated.' \
@@ -457,7 +460,7 @@
 
 				if not rc.authed():
 					raise Exception, 'authentication failed'
-			except:
+			except Exception, e:
 				cur_system['errors'] = True
 				incomplete = True
 				errors.append('Error authenticating to %s: %s' \
@@ -617,7 +620,7 @@
 				break
 			if code == -1:
 				errors.append(batch_ret[1])
-				raise Exception, batch_ret[1]
+				raise Exception, str(batch_ret[1])
 			if code == False:
 				time.sleep(0.5)
 	except Exception, e:
@@ -4137,13 +4140,13 @@
 
 def clusterDelete(self, model):
 	num_errors = clusterStop(self, model, delete=True)
-	if num_errors < 1:
-		try:
-			clustername = model.getClusterName()
-		except Exception, e:
-			luci_log.debug_verbose('clusterDelete0: unable to get cluster name')
-			return None
+	try:
+		clustername = model.getClusterName()
+	except Exception, e:
+		luci_log.debug_verbose('clusterDelete0: unable to get cluster name')
+		return None
 
+	if num_errors < 1:
 		try:
 			delCluster(self, clustername)
 		except Exception, e:
--- conga/luci/site/luci/Extensions/homebase_adapters.py	2007/02/09 18:32:04	1.48.2.1
+++ conga/luci/site/luci/Extensions/homebase_adapters.py	2007/02/12 20:25:42	1.48.2.2
@@ -156,7 +156,7 @@
 		if len(sysData) < 2 or not sysData[1]:
 			raise Exception, 'no password'
 		cur_pass = sysData[1]
-		cur_entry['passwd'] = ''
+		cur_entry['passwd'] = cur_pass
 	except:
 		luci_log.debug_verbose('vACI1: %s no password given')
 		request.SESSION.set('add_cluster_initial', cur_entry)
@@ -338,7 +338,7 @@
 	for i in node_list:
 		cur_node = { 'host': i }
 		if same_node_passwds:
-			cur_node['passwd'] = ''
+			cur_node['passwd'] = cur_pass
 		add_cluster['nodes'][i] = cur_node
 	request.SESSION.set('add_cluster', add_cluster)
 	request.response.redirect('/luci/homebase/index_html?pagetype=%s' % HOMEBASE_ADD_CLUSTER)
@@ -382,7 +382,7 @@
 			cur_passwd = None
 		else:
 			cur_passwd = sysData[1]
-			cur_system['passwd'] = ''
+			cur_system['passwd'] = cur_passwd
 
 		try:
 			cur_fp = request.form['__SYSTEM%dFingerprint' % i].strip()
--- conga/luci/site/luci/Extensions/ricci_communicator.py	2007/01/04 00:19:49	1.24
+++ conga/luci/site/luci/Extensions/ricci_communicator.py	2007/02/12 20:25:42	1.24.2.1
@@ -165,7 +165,7 @@
             pass
 
         if not self.authed():
-            raise RicciError, 'not authenticated to host %s', self.__hostname
+            raise RicciError, 'not authenticated to host %s' % self.__hostname
         
         # construct request
         doc = minidom.Document()




More information about the Cluster-devel mailing list