conga/luci cluster/fence_device.js cluster/for ...
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
luci/cluster/fence_device.js +11 -5
@@ -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 + '" />';
luci/cluster/form-macros +13 -5
@@ -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>
luci/site/luci/Extensions/cluster_adapters.py +9 -7
@@ -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