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

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



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

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

Log message:
	more robustness improvements

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

--- conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/11 17:29:46	1.26
+++ conga/luci/site/luci/Extensions/homebase_adapters.py	2006/10/11 18:44:05	1.27
@@ -925,9 +925,11 @@
 
 	try:
 		clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/')
+		if not clusters:
+			raise
 	except:
 		nodeUnauth(nodeList)
-		return 'Unable to create cluster \"' + clusterName + '\"'
+		return 'Unable to create cluster \"' + clusterName + '\": the cluster directory is missing.'
 
 	try:
 		newCluster = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName)
@@ -940,6 +942,8 @@
 	try:
 		clusters.manage_addFolder(clusterName, '__luci__:cluster')
 		newCluster = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName)
+		if not newCluster:
+			raise
 	except:
 		nodeUnauth(nodeList)
 		return 'Unable to create cluster \"' + clusterName + '\"'
@@ -949,8 +953,10 @@
 		newCluster.manage_role('View', ['Access Contents Information','View'])
 	except:
 		nodeUnauth(nodeList)
-		try: clusters.manage_delObjects([clusterName])
-		except: pass
+		try:
+			clusters.manage_delObjects([clusterName])
+		except:
+			pass
 		return 'Unable to set permissions on new cluster \"' + clusterName + '\"-- Cluster creation failed'
 
 	for i in nodeList:
@@ -968,8 +974,10 @@
 			newSystem.manage_role('View', [ 'Access contents information' , 'View' ])
 		except:
 			nodeUnauth(nodeList)
-			try: clusters.manage_delObjects([clusterName])
-			except: pass
+			try:
+				clusters.manage_delObjects([clusterName])
+			except:
+				pass
 			return 'Unable to create cluster node \"' + host + '\" for cluster \"' + clusterName + '\" -- Cluster creation failed."'
 
 	try:
@@ -977,7 +985,7 @@
 		if not ssystem:
 			raise
 	except:
-		return
+		return 'The storage directory is missing.'
 
 	# Only add storage systems if the cluster and cluster node DB
 	# objects were added successfully.
@@ -1057,6 +1065,8 @@
 def delSystem(self, systemName):
 	try:
 		ssystem = self.restrictedTraverse(PLONE_ROOT + '/systems/storage/')
+		if not ssystem:
+			raise
 	except:
 		return 'Unable to find storage system \"' + systemName + '\"'
 
@@ -1088,6 +1098,8 @@
 def delCluster(self, clusterName):
 	try:
 		clusters = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/')
+		if not clusters:
+			raise
 	except:
 		return 'Unable to find cluster \"' + clusterName + '\"'
 
@@ -1114,6 +1126,8 @@
 def delClusterSystems(self, clusterName):
 	try:
 		cluster = self.restrictedTraverse(PLONE_ROOT + '/systems/cluster/' + clusterName)
+		if not cluster:
+			raise
 		csystems = getClusterSystems(self, clusterName)
 	except:
 		return 'Unable to find any systems for cluster \"' + clusterName + '\"'


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