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: 10 Jan 2007 23:49:20 -0000	[thread overview]
Message-ID: <20070110234920.27684.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2007-01-10 23:49:19

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

Log message:
	fixes related to bz212021

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence_device.js.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.14&r2=1.90.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.120.2.17&r2=1.120.2.18

--- conga/luci/cluster/fence_device.js	2007/01/10 22:53:56	1.2.2.2
+++ conga/luci/cluster/fence_device.js	2007/01/10 23:49:18	1.2.2.3
@@ -208,13 +208,19 @@
 			{
 				temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" value="' + input_elem[j].value + '" />';
 			} else if (res_type == 'checkbox' || res_type == 'radio') {
-				if (input_elem[j].checked)
-					temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" checked="checked"';
-				if (res_type == 'radio')
-					temp += ' value="' + input_elem[j].value + '"';
-				temp += ' />';
+				if (input_elem[j].checked) {
+					temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '"';
+					if (res_type == 'checkbox')
+						temp += ' value="1"';
+					else if (res_type == 'radio')
+						temp += ' value="' + input_elem[j].value + '"';
+					temp += ' />';
+				} else if (res_type == 'checkbox') {
+					temp += '<input type="' + res_type + '" name="' + input_elem[j].name + '" value="0" />';
+				}
 			}
 		}
+
 		var select_elem = form[i].getElementsByTagName('select');
 		for (var j = 0 ; j < select_elem.length ; j++) {
 			temp += '<input type="text" name="' + select_elem[j].name + '" value="' + select_elem[j].options[select_elem[j].options.selectedIndex].value + '" />';
--- conga/luci/cluster/form-macros	2007/01/10 22:53:56	1.90.2.14
+++ conga/luci/cluster/form-macros	2007/01/10 23:49:18	1.90.2.15
@@ -2039,20 +2039,28 @@
 			<tr>
 				<td>Password</td>
 				<td>
-					<input name="password" type="password" autocomplete="off"
+					<input name="passwd" type="password" autocomplete="off"
 						tal:attributes="value cur_fencedev/passwd | nothing" />
 				</td>
 			</tr>
 			<tr>
 				<td>Authentication Type</td>
-				<td><input name="auth_type" type="text" Title="Options are to leave blank for none, password, md2, or md5"/></td>
+				<td>
+					<input name="auth_type" type="text" title="Options are to leave blank for none, password, md2, or md5"
+						tal:attributes="value cur_fencedev/auth_type | nothing" />
+				</td>
 			</tr>
 			<tr>
 				<td>Use Lanplus</td>
 				<td>
-					<input name="lanplus" type="checkbox"
-						tal:attributes="checked cur_fencedev/lanplus | nothing"
-					/>
+					<tal:block tal:condition="exists: cur_fencedev">
+						<input name="lanplus" type="checkbox"
+							tal:attributes="checked python: ('lanplus' in cur_fencedev and cur_fencedev['lanplus'] == '1') and 'checked' or ''"
+						/>
+					</tal:block>
+					<tal:block tal:condition="not:exists:cur_fencedev">
+						<input name="lanplus" type="checkbox" />
+					</tal:block>
 				</td>
 			</tr>
 		</table>
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/10 22:53:56	1.120.2.17
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/01/10 23:49:18	1.120.2.18
@@ -1613,7 +1613,7 @@
 					# user could not have edited it (without playing dirty
 					# games), so it's safe to pull the existing entry from
 					# the model. All we need is the device name.
-					pass
+					del fence_form['sharable']
 				else:
 					# An existing non-shared device; build up the device
 					# from scratch since the user could have edited it.
@@ -1665,6 +1665,8 @@
 			# <node><fence>. All we need for that is the device name.
 			if not 'sharable' in fence_form:
 				instance_list.append({'name': fencedev_name })
+			else:
+				del fence_form['sharable']
 
 		if fencedev_obj is not None:
 			# If a device with this name exists in the model
@@ -4387,7 +4389,7 @@
           last_kid_fd = None
           level1.append(fencedev)
         else:  #This dev is shared
-          if (last_kid_fd is not None) and (fd.getName().strip() == last_kid_fd.getName().strip()):  #just append a new instance struct to last_kid_fd
+          if (last_kid_fd is not None) and (fd.getName().strip() == last_kid_fd['name'].strip()):  #just append a new instance struct to last_kid_fd
             instance_struct = {}
             instance_struct['id'] = str(minor_num)
             minor_num = minor_num + 1
@@ -4400,7 +4402,7 @@
             #Now just add this struct to last_kid_fd and reset last_kid_fd
             ilist = last_kid_fd['instance_list']
             ilist.append(instance_struct)
-            last_kid_fd = fd
+            #last_kid_fd = fd
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
@@ -4428,7 +4430,7 @@
               instance_struct[kee] = kidattrs[kee]
             inlist.append(instance_struct) 
             level1.append(fencedev)
-            last_kid_fd = fd
+            last_kid_fd = fencedev
             continue
     map['level1'] = level1
 
@@ -4494,7 +4496,7 @@
           last_kid_fd = None
           level2.append(fencedev)
         else:  #This dev is shared
-          if (last_kid_fd is not None) and (fd.getName().strip() == last_kid_fd.getName().strip()):  #just append a new instance struct to last_kid_fd
+          if (last_kid_fd is not None) and (fd.getName().strip() == last_kid_fd['name'].strip()):  #just append a new instance struct to last_kid_fd
             instance_struct = {}
             instance_struct['id'] = str(minor_num)
             minor_num = minor_num + 1
@@ -4507,7 +4509,7 @@
             #Now just add this struct to last_kid_fd and reset last_kid_fd
             ilist = last_kid_fd['instance_list']
             ilist.append(instance_struct)
-            last_kid_fd = fd
+            #last_kid_fd = fd
             continue
           else: #Shared, but not used above...so we need a new fencedev struct
             fencedev = {}
@@ -4535,7 +4537,7 @@
               instance_struct[kee] = kidattrs[kee]
             inlist.append(instance_struct) 
             level2.append(fencedev)
-            last_kid_fd = fd
+            last_kid_fd = fencedev
             continue
     map['level2'] = level2
 



             reply	other threads:[~2007-01-10 23:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-10 23:49 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:47 rmccabe
2007-01-10 22:53 rmccabe
2007-01-08 21:58 rmccabe
2007-01-05 23:44 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=20070110234920.27684.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.