All of lore.kernel.org
 help / color / mirror / Atom feed
From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/fence_device.js cluster/for ...
Date: 5 Jan 2007 23:44:11 -0000	[thread overview]
Message-ID: <20070105234411.18147.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at 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'
 



             reply	other threads:[~2007-01-05 23:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05 23:44 rmccabe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-08-08 21:18 [Cluster-devel] conga/luci cluster/fence_device.js cluster/for rmccabe
2007-01-25 21:03 rmccabe
2007-01-10 23:49 rmccabe
2007-01-10 23:47 rmccabe
2007-01-10 22:53 rmccabe
2007-01-08 21:58 rmccabe
2006-12-01 14:56 rmccabe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070105234411.18147.qmail@sourceware.org \
    --to=rmccabe@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.