conga/luci cluster/form-macros cluster/validat ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-08-24 18:40:29
Modified files:
luci/cluster : form-macros validate_config_multicast.js
luci/site/luci/Extensions: LuciClusterInfo.py
cluster_adapters.py
luci/site/luci/Extensions/ClusterModel: ModelBuilder.py
Log message:
Fix the issue described in bz253994: Cannot specify multicast address for a cluster
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.176.2.19&r2=1.176.2.20
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_config_multicast.js.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.4.1&r2=1.3.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.10.2.1&r2=1.10.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.227.2.22&r2=1.227.2.23
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ClusterModel/ModelBuilder.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.1&r2=1.5.2.2
luci/cluster/form-macros +4 -4
@@ -1115,11 +1115,11 @@ Multicast address </td> <td class="systemsTable"> - <input type="text" name="mcast_address" id="mcast_address" + <input type="text" + name="mcast_address" id="mcast_address" tal:attributes=" - disabled python: clusterinfo['is_mcast'] != 'True' and '1' or '0'; - value python: clusterinfo['is_mcast'] == 'True' and clusterinfo['mcast_addr'] or '';" - /> + disabled not:clusterinfo/mcast_addr; + value clusterinfo/mcast_addr |nothing" /> </td> </tr> </tbody>
luci/cluster/validate_config_multicast.js +4 -2
@@ -11,8 +11,9 @@ function disable_mcast(addrId) { addrObj = document.getElementById(addrId); - if (!addrObj || addrObj.disabled) + if (!addrObj) { return; + } addrObj.disabled = true; prev_mcast_str = addrObj.value; addrObj.value = '';
@@ -20,8 +21,9 @@ function enable_mcast(addrId) { addrObj = document.getElementById(addrId); - if (!addrObj || !addrObj.disabled) + if (!addrObj) { return; + } addrObj.disabled = false; addrObj.value = prev_mcast_str; }
luci/site/luci/Extensions/LuciClusterInfo.py +1 -1
@@ -620,8 +620,8 @@ clumap['mcast_addr'] = model.getMcastAddr() clumap['is_mcast'] = 'True' else: + clumap['mcast_addr'] = None clumap['is_mcast'] = 'False' - clumap['mcast_addr'] = '1.2.3.4' clumap['gulm'] = False else: #-------------
luci/site/luci/Extensions/cluster_adapters.py +11 -3
@@ -1000,13 +1000,21 @@ else: addr_str = None - if (addr_str is None and mcast_manual is not True) or (mcast_manual is True and addr_str == model.getMcastAddr()): + try: + old_mcast_addr = model.getMcastAddr() + except Exception, e: + luci_log.debug_verbose('VMCC0: %r %s' % (e, str(e))) + old_mcast_addr = None + + if (addr_str is None and mcast_manual is not True and not old_mcast_addr) or (mcast_manual is True and addr_str == old_mcast_addr): errors.append('No multicast configuration changes were made') return (False, {'errors': errors}) try: - model.usesMulticast = True - model.mcast_address = addr_str + if model.getMcastAddr() is not None and not addr_str: + model.del_cluster_multicast() + else: + model.set_cluster_multicast(addr_str) except Exception, e: if LUCI_DEBUG_MODE is True: luci_log.debug('Error updating mcast properties: %r %s' \
luci/site/luci/Extensions/ClusterModel/ModelBuilder.py +78 -49
160 lines not on this page · raw message