[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	2007-01-17 22:14:02

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

Log message:
	force users to provide a fence name for new devices created in the node context

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

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/11 22:49:42	1.203
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/17 22:14:02	1.204
@@ -1600,7 +1600,13 @@
 
 		if 'existing_device' in fence_form:
 			del fence_form['existing_device']
-			fencedev_name = fence_form['name']
+
+			try:
+				fencedev_name = fence_form['name']
+				if not fencedev_name.strip():
+					raise Exception, 'no fence name'
+			except Exception, e:
+				return (False, {'errors': [ 'You must provide a unique name for all fence devices.' ]})
 
 			if fence_type is None:
 				# An unknown device. Pull the data out of
@@ -1654,7 +1660,13 @@
 					instance_list.append({'name': fencedev_name })
 		else:
 			# The user created a new fence device.
-			fencedev_name = fence_form['name']
+			try:
+				fencedev_name = fence_form['name']
+				if not fencedev_name.strip():
+					raise Exception, 'no fence name'
+			except Exception, e:
+				return (False, {'errors': [ 'You must provide a unique name for all fence devices.' ]})
+
 			fencedev_obj = FenceDevice()
 			for k in fence_form.keys():
 				if fence_form[k]:


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