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

[Cluster-devel] conga/luci cluster/fence_device.js cluster/for ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-01-05 23:44:11

Modified files:
	luci/cluster   : fence_device.js form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 
	                           conga_constants.py 

Log message:
	more node-specific fencing updates

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence_device.js.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.141&r2=1.142
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.193&r2=1.194
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.32&r2=1.33

--- conga/luci/cluster/fence_device.js	2007/01/05 23:26:11	1.3
+++ conga/luci/cluster/fence_device.js	2007/01/05 23:44:10	1.4
@@ -169,6 +169,5 @@
 	master_form.fence_xml.value = '<formlist>' + form_xml + '</formlist>';
 
 	if (confirm('Submit: ' + master_form.fence_xml.value))
-		return;
-		//form.submit();
+		master_form.submit();
 }
--- conga/luci/cluster/form-macros	2007/01/05 23:26:11	1.141
+++ conga/luci/cluster/form-macros	2007/01/05 23:44:10	1.142
@@ -2863,9 +2863,10 @@
 						onclick="add_node_fence_device(1)" />
 				</div>
 				<div class="hbSubmit">
-					<form name="fence1_master">
+					<form name="fence1_master" method="post" action="">
 						<input type="hidden" name="fence_level" value="1" />
 						<input type="hidden" name="fence_xml" value="" />
+						<input type="hidden" name="pagetype" value="58" />
 						<input type="button"
 							value="Update fence properties"
 							onclick="validate_fence(this.form, 'fence_list_level1')" />
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/02 20:12:22	1.193
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/05 23:44:10	1.194
@@ -1433,6 +1433,51 @@
     errors.append(error_string)
     return (False, {'errors': errors, 'messages': messages})
 
+def validateNodeFenceConfig(self, request):
+	try:
+		form_xml = request['fence_xml']
+		if not form_xml:
+			raise KeyError, 'form_xml must not be blank'
+	except Exception, e:
+		luci_log.debug_verbose('vNFC0: no form_xml: %s' % str(e))
+		return (False, {'errors': ['No fence data was supplied.']})
+
+	try:
+		doc = minidom.parseString(form_xml)
+		forms = doc.getElementsByTagName('form')
+		if len(forms) < 1:
+			raise
+	except Exception, e:
+		luci_log.debug_verbose('vNFC1: error: %s' % str(e))
+		return (False, {'errors': ['The fence data submitted is not properly formed.']})
+
+	form_hash = {}
+	for i in forms:
+		form_id = i.getAttribute('name')
+		if not form_id:
+			continue
+		ielems = i.getElementsByTagName('input')
+		if not ielems or len(ielems) < 1:
+			continue
+
+		dummy_form = {}
+
+		for i in ielems:
+			try:
+				input_type = str(i.getAttribute('type'))
+			except:
+				continue
+			if not input_type or input_type == 'button':
+				continue
+			try:
+				dummy_form[str(i.getAttribute('name'))] = str(i.getAttribute('value'))
+			except Exception, e:
+				luci_log.debug_verbose('vNFC2: parsing XML: %s' % str(e))
+				pass
+
+			form_hash[form_id] = dummy_form
+	luci_log.debug_verbose('vNFC3: got xml: %s' % doc.toxml())
+	return (False, { 'errors': [ doc.toxml() ]})
 
 def deleteFenceDevice(self, request):
   errors = list()
@@ -1654,7 +1699,8 @@
 	51: validateFenceAdd,
 	50: validateFenceEdit,
 	55: validateDaemonProperties,
-  57: deleteFenceDevice
+	57: deleteFenceDevice,
+	58: validateNodeFenceConfig
 }
 
 def validatePost(self, request):
--- conga/luci/site/luci/Extensions/conga_constants.py	2006/12/21 21:26:20	1.32
+++ conga/luci/site/luci/Extensions/conga_constants.py	2007/01/05 23:44:11	1.33
@@ -45,6 +45,7 @@
 CLUSTER_DAEMON="55"
 SERVICE_DELETE = '56'
 FENCEDEV_DELETE = "57"
+FENCEDEV_NODE_CONFIG = '58'
 
 CONF_EDITOR = '80'
 


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