[luci] Correct duplication of the fence brocade menu item in the fence devices section
by Ryan McCabe
commit f14bf3185df12612d1456da3aaebc7405dc7c3ca
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Mon Mar 28 15:49:00 2011 -0400
Correct duplication of the fence brocade menu item in the fence devices section
luci/templates/fence_devices.html | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
---
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index 3f1c50c..7099df0 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -3033,7 +3033,6 @@ ${fence_unknown(None,0)}
<option name="fence_rhevm" value="fence_rhevm">RHEV-M fencing</option>
<option name="fence_ipmilan" value="fence_ipmilan">IPMI Lan</option>
- <option name="fence_brocade" value="fence_brocade">Brocade Fabric Switch</option>
<option py:if="cluster_version == 2" name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
<option py:if="cluster_version == 2" name="fence_mcdata" value="fence_mcdata">McData SAN Switch</option>
13 years, 2 months
[luci] Fix possible exception path in the luci cluster model object
by Ryan McCabe
commit f91aa21aada377d8c48c8bb1f0d7ed5b1785c810
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Mon Mar 28 15:48:28 2011 -0400
Fix possible exception path in the luci cluster model object
luci/lib/ClusterConf/ModelBuilder.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/luci/lib/ClusterConf/ModelBuilder.py b/luci/lib/ClusterConf/ModelBuilder.py
index 9525c16..87d2768 100644
--- a/luci/lib/ClusterConf/ModelBuilder.py
+++ b/luci/lib/ClusterConf/ModelBuilder.py
@@ -720,6 +720,11 @@ class ModelBuilder:
self.cluster_ptr.addChild(rm)
self.resourcemanager_ptr = rm
+ if self.cman_ptr is None:
+ cman = Cman.Cman()
+ self.cluster_ptr.addChild(cman)
+ self.cman_ptr = cman
+
if self.failoverdomains_ptr is None:
fdoms = FailoverDomains.FailoverDomains()
self.resourcemanager_ptr.addChild(fdoms)
@@ -1043,12 +1048,6 @@ class ModelBuilder:
def check_two_node(self):
clusternodes_count = len(self.getNodes())
- # Make certain that there is a cman tag in the file
- # If missing, it will not hurt to add it here
- if self.cman_ptr is None:
- cman = Cman.Cman()
- self.cluster_ptr.addChild(cman)
- self.cman_ptr = cman
if self.isQuorumd():
self.cman_ptr.delTwoNode()
13 years, 2 months
[luci] Add support for the fence_cisco_ucs "suborg" option
by Ryan McCabe
commit 6c82e3e36cb65d2ba593dca518ebe928874bd0b8
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Mar 25 17:08:55 2011 -0400
Add support for the fence_cisco_ucs "suborg" option
luci/templates/fence_devices.html | 7 +++++++
luci/widget_validators/validate_fence.py | 1 +
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index cbb1603..3f1c50c 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -1924,6 +1924,13 @@
</td>
</tr>
<tr>
+ <td>Sub-organization</td>
+ <td>
+ <input name="suborg" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('suborg')} or {}"/>
+ </td>
+ </tr>
+ <tr>
<td>Power wait (seconds)</td>
<td>
<input type="text" class="text" name="power_wait"
diff --git a/luci/widget_validators/validate_fence.py b/luci/widget_validators/validate_fence.py
index 4ae5308..dd193c8 100644
--- a/luci/widget_validators/validate_fence.py
+++ b/luci/widget_validators/validate_fence.py
@@ -497,6 +497,7 @@ def val_cisco_ucs_fd(fencedev, fence_name, **kw):
('passwd', False),
('passwd_script', False),
('ssl', False),
+ ('suborg', False),
('power_wait', False),
)
13 years, 2 months
[luci] Sync up with the current schema - Remove config_file attribute configuration from DRBD - Add named
by Ryan McCabe
commit 1242967d43f3abe5a43901849d678daa6493de6d
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Thu Mar 17 01:00:34 2011 -0400
Sync up with the current schema
- Remove config_file attribute configuration from DRBD
- Add named_sdb option to the bind9 resource agent
- Fix interaction of old and new samba resource agents
luci/templates/resource_list.html | 60 +++++++++++++++++++--------
luci/widget_validators/validate_resource.py | 15 +++++--
2 files changed, 53 insertions(+), 22 deletions(-)
---
diff --git a/luci/templates/resource_list.html b/luci/templates/resource_list.html
index 91c27dc..9f2547e 100644
--- a/luci/templates/resource_list.html
+++ b/luci/templates/resource_list.html
@@ -517,7 +517,7 @@
</table>
</div>
-<div py:def="smb_resource(res, form_id, parent_id, isref)" name="SMB" id="smb_resource" class="row rescfg"
+<div py:def="samba_resource(res, form_id, parent_id, isref)" name="SAMBA" id="samba_resource" class="row rescfg"
py:with="global_resource = res and isref != 0"
py:attrs="res and {'id': 'global_res_%s' % res.getName(), 'name': res.getName()}">
<input name="global" type="hidden" value="1" py:if="global_resource"/>
@@ -525,7 +525,7 @@
<input name="form_id" type="hidden" value="${form_id}"/>
<input name="oldname" type="hidden"
py:attrs="res and {'value':res.getAttribute('name')} or {}" />
- <input name="type" type="hidden" value="smb" />
+ <input name="type" type="hidden" value="samba" />
<h3>Samba Server</h3>
<table class="formtable">
@@ -536,13 +536,6 @@
py:attrs="res and {'value':res.getAttribute('name'), 'disabled':global_resource and 'disabled' or None} or {}" />
</td>
</tr>
- <tr py:if="False">
- <td>Workgroup</td>
- <td>
- <input type="text" class="text" name="workgroup"
- py:attrs="res and {'value':res.getAttribute('workgroup'), 'disabled':global_resource and 'disabled' or None} or {}" />
- </td>
- </tr>
<tr>
<td>Config file</td>
<td>
@@ -575,6 +568,36 @@
</table>
</div>
+<div py:def="smb_resource(res, form_id, parent_id, isref)" name="SMB" id="smb_resource" class="row rescfg"
+ py:with="global_resource = res and isref != 0"
+ py:attrs="res and {'id': 'global_res_%s' % res.getName(), 'name': res.getName()}">
+ <input name="global" type="hidden" value="1" py:if="global_resource"/>
+ <input name="parent_id" type="hidden" value="${parent_id}"/>
+ <input name="form_id" type="hidden" value="${form_id}"/>
+ <input name="oldname" type="hidden"
+ py:attrs="res and {'value':res.getAttribute('name')} or {}" />
+ <input name="type" type="hidden" value="smb" />
+
+ <h3>Samba Server</h3>
+ <table class="formtable">
+ <tr>
+ <td>Name</td>
+ <td>
+ <input type="text" class="text" name="resourcename"
+ py:attrs="res and {'value':res.getAttribute('name'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>Workgroup</td>
+ <td>
+ <input type="text" class="text" name="workgroup"
+ py:attrs="res and {'value':res.getAttribute('workgroup'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ ${res_footer(res)}
+ </table>
+</div>
+
<div py:def="script_resource(res, form_id, parent_id, isref)" name="SCRIPT" id="script_resource" class="row rescfg"
py:with="global_resource = res and isref != 0"
py:attrs="res and {'id': 'global_res_%s' % res.getName(), 'name': res.getName()}">
@@ -1504,7 +1527,6 @@
py:attrs="res and {'value':res.getAttribute('name'), 'disabled':global_resource and 'disabled' or None} or {}" />
</td>
</tr>
-
<tr>
<td>Full path to config file</td>
<td>
@@ -1521,6 +1543,13 @@
</td>
</tr>
<tr>
+ <td>Use simplified database backend</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="named_sdb"
+ py:attrs="{'checked':(res and res.getAttribute('named_sdb')) and 'checked' or None, 'disabled':global_resource and 'disabled' or None}"/>
+ </td>
+ </tr>
+ <tr>
<td>Other command line options</td>
<td>
<input type="text" class="text" name="named_options"
@@ -1558,13 +1587,6 @@
</td>
</tr>
<tr>
- <td>Full path to config file</td>
- <td>
- <input type="text" class="text" name="config_file"
- py:attrs="res and {'value':res.getAttribute('config_file'), 'disabled':global_resource and 'disabled' or None} or {}" />
- </td>
- </tr>
- <tr>
<td>DRBD resource name, as specified in /etc/drbd.conf</td>
<td>
<input type="text" class="text" name="resource"
@@ -1659,6 +1681,7 @@ ${netfs_resource(None,None,None,0)}
${nfsexport_resource(None,None,None,0)}
${nfsclient_resource(None,None,None,0)}
${nfsserver_resource(None,None,None,0)}
+${samba_resource(None,None,None,0)}
${smb_resource(None,None,None,0)}
${script_resource(None,None,None,0)}
${apache_resource(None,None,None,0)}
@@ -1736,7 +1759,8 @@ ${vm_resource(None,None,None,0)}
<option name="postgres8_resource" value="postgres8_resource">PostgreSQL 8</option>
<option name="SAPDatabase_resource" value="SAPDatabase_resource">SAP Database</option>
<option name="SAPInstance_resource" value="SAPInstance_resource">SAP Instance</option>
- <option name="smb_resource" value="smb_resource">Samba Server</option>
+ <option name="samba_resource" value="samba_resource">Samba Server</option>
+ <option py:if="cluster_os != 'RHEL'" name="smb_resource" value="smb_resource">(old) Samba Server</option>
<option name="script_resource" value="script_resource">Script</option>
<option name="ASEHAagent_resource" value="ASEHAagent_resource">Sybase ASE Failover Instance</option>
<option py:if="cluster_version < 3" name="tomcat5_resource" value="tomcat5_resource">Tomcat 5</option>
diff --git a/luci/widget_validators/validate_resource.py b/luci/widget_validators/validate_resource.py
index 5a530a0..206a77a 100644
--- a/luci/widget_validators/validate_resource.py
+++ b/luci/widget_validators/validate_resource.py
@@ -14,6 +14,7 @@ from luci.lib.ClusterConf.NFSClient import NFSClient
from luci.lib.ClusterConf.NFSServer import NFSServer
from luci.lib.ClusterConf.Script import Script
from luci.lib.ClusterConf.Samba import Samba
+from luci.lib.ClusterConf.Smb import Smb
from luci.lib.ClusterConf.Tomcat5 import Tomcat5
from luci.lib.ClusterConf.Tomcat6 import Tomcat6
from luci.lib.ClusterConf.Postgres8 import Postgres8
@@ -234,6 +235,13 @@ def addScript(res, rname, model, **kw):
errors = config_resource(params, res, rname, **kw)
return errors
+def addSmb(res, rname, model, **kw):
+ params = (
+ ('workgroup', '', False, None),
+ )
+ errors = config_resource(params, res, rname, **kw)
+ return errors
+
def addSamba(res, rname, model, **kw):
params = (
('config_file', _('Path to configuration file'), False, None),
@@ -299,8 +307,6 @@ def addTomcat5(res, rname, model, **kw):
def addTomcat6(res, rname, model, **kw):
params = (
('config_file', _('Path to configuration file'), False, None),
- # XXX really not supported?
- # ('tomcat_user', '', False, None),
('shutdown_wait', '', False, None)
)
errors = config_resource(params, res, rname, **kw)
@@ -417,6 +423,7 @@ def addNamed(res, rname, model, **kw):
params = (
('config_file', _('named config file'), False, None),
('named_working_dir', _('named working directory'), False, None),
+ ('named_sdb', _('named simplified database backend'), False, None),
('named_options', _('Other command line options'), False, None),
('shutdown_wait', _('Shutdown Wait Time'), False, None)
)
@@ -425,7 +432,6 @@ def addNamed(res, rname, model, **kw):
def addDRBD(res, rname, model, **kw):
params = (
- ('config_file', _('drbd config file'), False, None),
('resource', _('drbd resource name'), True, None),
)
errors = config_resource(params, res, rname, **kw)
@@ -440,7 +446,8 @@ resource_table = {
'nfsclient': ( addNFSClient, NFSClient ),
'nfsserver': ( addNFSServer, NFSServer ),
'script': ( addScript, Script ),
- 'smb': ( addSamba, Samba ),
+ 'samba': ( addSamba, Samba ),
+ 'smb': ( addSmb, Smb ),
'tomcat-5': ( addTomcat5, Tomcat5 ),
'tomcat-6': ( addTomcat6, Tomcat6 ),
'postgres-8': ( addPostgres8, Postgres8 ),
13 years, 2 months
[luci] Disable depend_mode when no dependency is entered, and make it default to hard otherwise
by Ryan McCabe
commit 0a08a48863ad9fdcfc22f519b486c8d58f780dbb
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Mar 16 14:12:30 2011 -0400
Disable depend_mode when no dependency is entered, and make it default to hard otherwise
luci/lib/ClusterConf/Service.py | 4 +++-
luci/lib/ricci_communicator.py | 5 ++++-
luci/templates/resource_list.html | 24 +++++++++++++-----------
3 files changed, 20 insertions(+), 13 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Service.py b/luci/lib/ClusterConf/Service.py
index e1f62e0..c94c27e 100644
--- a/luci/lib/ClusterConf/Service.py
+++ b/luci/lib/ClusterConf/Service.py
@@ -15,7 +15,7 @@ class Service(TagObject):
'nfslock': '0',
'nfs_client_cache': '0',
'exclusive': '0',
- 'depend_mode': 'soft',
+ 'depend_mode': 'hard',
}
def __init__(self):
TagObject.__init__(self)
@@ -133,3 +133,5 @@ class Service(TagObject):
self.delNFSClientCache()
if self.getExclusive() == self.DEFAULTS.get('exclusive'):
self.delExclusive()
+ if not self.getDepend() or self.getDependMode() == self.DEFAULTS.get('depend_mode'):
+ self.delDependMode()
diff --git a/luci/lib/ricci_communicator.py b/luci/lib/ricci_communicator.py
index e63adb4..00ef567 100644
--- a/luci/lib/ricci_communicator.py
+++ b/luci/lib/ricci_communicator.py
@@ -419,6 +419,7 @@ class RicciCommunicator:
self.ss.settimeout(timeout)
xml_in = []
doc = None
+ err = 0
while doc is None:
try:
@@ -434,7 +435,9 @@ class RicciCommunicator:
errstr = 'Error reading from %s:%d: %s' \
% (self.__hostname, self.__port, e)
log.exception(errstr)
- raise RicciError, errstr
+ err += 1
+ if err >= 5:
+ raise RicciError, errstr
doc = None
try:
diff --git a/luci/templates/resource_list.html b/luci/templates/resource_list.html
index d17f9e2..91c27dc 100644
--- a/luci/templates/resource_list.html
+++ b/luci/templates/resource_list.html
@@ -1808,17 +1808,6 @@ ${vm_resource(None,None,None,0)}
</td>
</tr>
<tr py:if="expertMode">
- <td>Service dependency mode</td>
- <td>
- <select name="depend_mode">
- <option value="soft"
- py:attrs="(svc and svc.getDependMode() == 'soft') and {'selected':'selected'} or {}">soft</option>
- <option value="hard"
- py:attrs="(svc and svc.getDependMode() == 'hard') and {'selected':'selected'} or {}">hard</option>
- </select>
- </td>
- </tr>
- <tr py:if="expertMode">
<td>Priority (central processing mode only)</td>
<td>
<input type="text" class="text" name="priority"
@@ -1832,9 +1821,22 @@ ${vm_resource(None,None,None,0)}
<td>Top-level service this service depends on</td>
<td>
<input name="depend" type="text" class="text"
+ onchange="if (!$.trim(this.value)) {$(':input[name=depend_mode]').attr('disabled', 'disabled');} else {$(':input[name=depend_mode]').removeAttr('disabled');}"
py:attrs="svc and {'value':svc.getDepend()} or {}"/>
</td>
</tr>
+ <tr py:if="expertMode">
+ <td>Service dependency mode</td>
+ <td>
+ <select name="depend_mode"
+ py:attrs="(not svc or not svc.getDepend()) and {'disabled':'disabled'} or {}">
+ <option value="hard"
+ py:attrs="(not svc or svc.getDependMode() == 'hard') and {'selected':'selected'} or {}">hard</option>
+ <option value="soft"
+ py:attrs="(svc and svc.getDependMode() == 'soft') and {'selected':'selected'} or {}">soft</option>
+ </select>
+ </td>
+ </tr>
<tr>
<td>Recovery policy</td>
<td>
13 years, 2 months
[luci] Allow users to configure the new <cman><multicast ttl="x"/></cman> attribute when in expert mode
by Ryan McCabe
commit e02b06a28fcb0dcb47ba43f5fe3203582b618c00
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Mar 16 00:35:46 2011 -0400
Allow users to configure the new <cman><multicast ttl="x"/></cman> attribute when in expert mode
luci/lib/ClusterConf/ModelBuilder.py | 16 ++++++++++--
luci/lib/ClusterConf/Multicast.py | 23 +++++++++++++++--
luci/templates/configure.html | 29 ++++++++++++++--------
luci/widget_validators/validate_cluster_prop.py | 16 ++++++++++++
4 files changed, 67 insertions(+), 17 deletions(-)
---
diff --git a/luci/lib/ClusterConf/ModelBuilder.py b/luci/lib/ClusterConf/ModelBuilder.py
index b60d514..9525c16 100644
--- a/luci/lib/ClusterConf/ModelBuilder.py
+++ b/luci/lib/ClusterConf/ModelBuilder.py
@@ -671,6 +671,15 @@ class ModelBuilder:
return
+ def getMcastPtr(self):
+ return self.mcast_ptr
+
+ def addMcastPtr(self):
+ if self.mcast_ptr is None:
+ self.mcast_ptr = Multicast.Multicast()
+ self.cman_ptr.addChild(self.mcast_ptr)
+ return self.mcast_ptr
+
def getMcastAddr(self):
if self.mcast_ptr is not None:
return self.mcast_ptr.getAddr()
@@ -909,14 +918,15 @@ class ModelBuilder:
return True
def set_cluster_multicast(self, mcast_addr=None):
- self.del_cluster_multicast()
self.del_cluster_broadcast()
self.del_cluster_udpu()
if mcast_addr is not None:
if self.mcast_ptr is None:
- self.mcast_ptr = Multicast.Multicast()
- self.cman_ptr.addChild(self.mcast_ptr)
+ self.addMcastPtr()
self.mcast_ptr.setAddr(mcast_addr)
+ else:
+ if self.mcast_ptr is not None:
+ self.mcast_ptr.delAddr()
def get_cluster_udpu(self):
if self.cman_ptr is None:
diff --git a/luci/lib/ClusterConf/Multicast.py b/luci/lib/ClusterConf/Multicast.py
index 5940b5a..fa16590 100644
--- a/luci/lib/ClusterConf/Multicast.py
+++ b/luci/lib/ClusterConf/Multicast.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2010 Red Hat, Inc.
+# Copyright (C) 2006-2011 Red Hat, Inc.
#
# This program is free software; you can redistribute
# it and/or modify it under the terms of version 2 of the
@@ -10,9 +10,13 @@ from TagObject import TagObject
TAG_NAME = "multicast"
class Multicast(TagObject):
+ DEFAULTS = {
+ 'ttl': '1',
+ }
def __init__(self):
TagObject.__init__(self)
self.TAG_NAME = TAG_NAME
+ self.attr_hash.update(self.DEFAULTS)
def getAddr(self):
return self.getAttribute('addr')
@@ -20,5 +24,18 @@ class Multicast(TagObject):
def setAddr(self, val):
return self.addAttribute('addr', val)
- def delAddr(self, val):
- return self.removeAttribute('addr', val)
+ def delAddr(self):
+ return self.removeAttribute('addr')
+
+ def getTTL(self):
+ return self.getAttribute('ttl')
+
+ def setTTL(self, val):
+ return self.addIntegerAttribute('ttl', val, (0, 255))
+
+ def delTTL(self):
+ return self.removeAttribute('ttl')
+
+ def removeDefaults(self):
+ if self.getTTL() == self.DEFAULTS.get('ttl'):
+ self.delTTL()
diff --git a/luci/templates/configure.html b/luci/templates/configure.html
index 7bf66f2..a5627ed 100644
--- a/luci/templates/configure.html
+++ b/luci/templates/configure.html
@@ -42,8 +42,6 @@
});
</script>
- <script type="text/javascript">
- </script>
<div id="tabs"
py:with="cluster_os = tmpl_context.cluster.get_OS();
os_version = tmpl_context.cluster.get_OSVersion()">
@@ -123,32 +121,35 @@
</form>
</div>
<div id="tabs-3">
- <form action="${tg.url(configure_cmd)}" method="post">
- <input py:if="expertMode" type="hidden" name="expert_mode" value="1"/>
- <input type="hidden" name="page" value="Network"/>
- <h2>Network Configuration</h2>
- <div class="row"
+ <form action="${tg.url(configure_cmd)}" method="post"
py:with="
uses_broadcast = cluster_data and cluster_data.get_cluster_broadcast();
uses_udpu = cluster_data and cluster_data.get_cluster_udpu();
multicast_addr = cluster_data and cluster_data.getMcastAddr()">
+ <input py:if="expertMode" type="hidden" name="expert_mode" value="1"/>
+ <input type="hidden" name="page" value="Network"/>
+ <h2>Network Configuration</h2>
+ <div class="row">
<fieldset><legend>Network transport type</legend>
<input name="multicast" value="multicast" class="radio" type="radio"
+ onclick="$('.mcast_only', this.form).removeAttr('disabled')"
py:attrs="(uses_broadcast is not True and uses_udpu is not True and multicast_addr is None) and {'checked': 'checked'} or {}"/>
<label class="choice">UDP multicast and let cluster choose the multicast address</label>
- <br />
+ <br/>
<input name="multicast" value="multicast_manual" class="radio" type="radio"
+ onclick="$('.mcast_only', this.form).removeAttr('disabled')"
py:attrs="(uses_broadcast is not True and uses_udpu is not True and multicast_addr is not None) and {'checked': 'checked'} or {}"/>
<label class="choice">UDP multicast and specify the multicast address manually</label>
- <br />
+ <br/>
<label class="indent">Multicast address</label>
<input type="text" class="text" name="mcast_address" value="${cluster_data and cluster_data.getMcastAddr()}"/>
- <br />
+ <br/>
<py:if test="expertMode or (cluster_os != 'RHEL' or os_version < 6.1)">
<input name="multicast" value="broadcast" class="radio" type="radio"
+ onclick="$('.mcast_only', this.form).attr('disabled', 'disabled')"
py:attrs="uses_broadcast is True and {'checked': 'checked'} or {}"/>
<label class="choice">UDP broadcast</label>
<br/>
@@ -156,13 +157,19 @@
<py:if test="cluster_os != 'RHEL' or os_version > 6.0">
<input name="multicast" value="udpu" class="radio" type="radio"
+ onclick="$('.mcast_only', this.form).attr('disabled', 'disabled')"
py:attrs="uses_udpu is True and {'checked': 'checked'} or {}"/>
<label class="choice">UDP unicast (UDPU)</label>
</py:if>
</fieldset>
</div>
<div id="advanced" py:if="expertMode"
- py:with="totem=cluster_data and cluster_data.getTotemPtr()">
+ py:with="totem = cluster_data and cluster_data.getTotemPtr();
+ mcast = cluster_data and cluster_data.getMcastPtr()">
+ <div class="row" py:if="cluster_os != 'RHEL' or os_version > 6.0">
+ <label class="wide">Multicast packet TTL</label>
+ <input name="ttl" class="text mcast_only" type="text" py:attrs="{'value': mcast and mcast.getTTL() or '1', 'disabled': (uses_broadcast or uses_udpu) and 'disabled' or None}"/>
+ </div>
<div class="row"><label class="wide">Token timeout (ms)</label><input name="token_timeout" class="text" type="text" py:attrs="totem and { 'value': totem.getTokenTimeout() } or {}"/></div>
<div class="row"><label class="wide">Number of token retransmits</label><input name="token_retransmits" class="text" type="text" py:attrs="totem and { 'value': totem.getTokenRetransmits() } or {}"/></div>
<div class="row"><label class="wide">Join Timeout (ms)</label><input name="join_timeout" class="text" type="text" py:attrs="totem and { 'value': totem.getJoinTimeout() } or {}"/></div>
diff --git a/luci/widget_validators/validate_cluster_prop.py b/luci/widget_validators/validate_cluster_prop.py
index 8ab1c49..c43b361 100644
--- a/luci/widget_validators/validate_cluster_prop.py
+++ b/luci/widget_validators/validate_cluster_prop.py
@@ -511,6 +511,7 @@ def validate_fenced_config(model, **kw):
def validate_network_config(model, **kw):
errors = []
+ uses_mcast = True
multicast = kw.get('multicast')
mcast_addr = kw.get('mcast_address')
@@ -521,8 +522,10 @@ def validate_network_config(model, **kw):
model.set_cluster_multicast(mcast_addr)
elif multicast == "broadcast":
model.set_cluster_broadcast()
+ uses_mcast = False
elif multicast == "udpu":
model.set_cluster_udpu()
+ uses_mcast = False
else:
return (False, {'errors': [ _('Invalid value for multicast configuration: %s') % multicast]})
@@ -534,6 +537,19 @@ def validate_network_config(model, **kw):
if totem is None:
totem = model.addTotem()
+ mcast_ttl = kw.get('ttl')
+ mcast_ptr = model.getMcastPtr()
+ if uses_mcast is True and mcast_ttl and not mcast_ttl.isspace():
+ try:
+ if not mcast_ptr:
+ mcast_ptr = model.addMcastPtr()
+ mcast_ptr.setTTL(mcast_ttl)
+ except:
+ errors.append(_('Invalid multicast packet TTL: %s') % mcast_ttl)
+ else:
+ if mcast_ptr:
+ mcast_ptr.delTTL()
+
join_timeout = kw.get('join_timeout')
if join_timeout and not join_timeout.isspace():
try:
13 years, 2 months
[luci] Fix a bug that caused an exception when adding nodes to an existing cluster
by Ryan McCabe
commit e4845a4dd6c1f13c1e730bdef4203f7c961a5cdc
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Mar 4 12:06:22 2011 -0500
Fix a bug that caused an exception when adding nodes to an existing cluster
.../validate_create_cluster_form.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/luci/widget_validators/validate_create_cluster_form.py b/luci/widget_validators/validate_create_cluster_form.py
index f07125e..b7d558a 100644
--- a/luci/widget_validators/validate_create_cluster_form.py
+++ b/luci/widget_validators/validate_create_cluster_form.py
@@ -214,7 +214,7 @@ def validate_node_add_form(model, db_obj, **kw):
last_node_id = 0
try:
- last_node_id = max([int(n.getID()) for n in model.getNodes()])
+ last_node_id = max([int(n.getNodeID()) for n in model.getNodes()])
except:
errors.append(_('Error getting node IDs for cluster %s') % cluster_name)
log.exception('Error getting node IDs for cluster %s' % cluster_name)
13 years, 2 months
[luci] Add DRBD to the list of resources displayed for RHEL6 clusters
by Ryan McCabe
commit c4cd56f29bb33b8fbe8e9225a65576ab7f54b9e8
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Mar 4 12:05:44 2011 -0500
Add DRBD to the list of resources displayed for RHEL6 clusters
luci/templates/resource_list.html | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/luci/templates/resource_list.html b/luci/templates/resource_list.html
index f868f69..d17f9e2 100644
--- a/luci/templates/resource_list.html
+++ b/luci/templates/resource_list.html
@@ -1710,6 +1710,9 @@ ${vm_resource(None,None,None,0)}
<option selected="selected" disabled="disabled">-- Select a resource type --</option>
<option name="apache_resource" value="apache_resource">Apache</option>
+ <py:if test="cluster_version >= 3">
+ <option name="drbd_resource" value="drbd_resource">DRBD resource</option>
+ </py:if>
<option name="fs_resource" value="fs_resource">Filesystem</option>
<py:choose test="cluster_version">
<py:when test="3">
@@ -1739,9 +1742,8 @@ ${vm_resource(None,None,None,0)}
<option py:if="cluster_version < 3" name="tomcat5_resource" value="tomcat5_resource">Tomcat 5</option>
<option py:if="cluster_version >= 3" name="tomcat6_resource" value="tomcat6_resource">Tomcat 6</option>
<option name="vm_resource" value="vm_resource" py:if="model">Virtual machine</option>
- <py:if test="cluster_version >= 3 and cluster_os != 'RHEL'">
- <option name="named_resource" value="named_resource">named (Bind 9) resource</option>
- <option name="drbd_resource" value="drbd_resource">DRBD resource</option>
+ <py:if test="cluster_version >= 3">
+ <option py:if="cluster_os != 'RHEL'" name="named_resource" value="named_resource">named (Bind 9) resource</option>
</py:if>
</select>
</div>
13 years, 2 months
[luci] Add fence_brocade to the list of fence devices on RHEL6 clusters
by Ryan McCabe
commit 6f2c69a059207fe296ac8168fec5938ee7b2aeef
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Fri Mar 4 12:05:26 2011 -0500
Add fence_brocade to the list of fence devices on RHEL6 clusters
luci/templates/fence_devices.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index 2da7876..cbb1603 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -2987,7 +2987,7 @@ ${fence_unknown(None,0)}
<option selected="selected" disabled="disabled">-- Select a fence device --</option>
<option name="fence_apc" value="fence_apc">APC Power Switch</option>
<option name="fence_apc_snmp" value="fence_apc_snmp">APC Power Switch (SNMP interface)</option>
- <option py:if="cluster_version == 2" name="fence_brocade" value="fence_brocade">Brocade Fabric Switch</option>
+ <option name="fence_brocade" value="fence_brocade">Brocade Fabric Switch</option>
<option py:if="cluster_version == 2" name="fence_bullpap" value="fence_bullpap">Bull PAP</option>
<option name="fence_cisco_mds" value="fence_cisco_mds">Cisco MDS</option>
<option name="fence_cisco_ucs" value="fence_cisco_ucs">Cisco UCS</option>
@@ -3026,7 +3026,7 @@ ${fence_unknown(None,0)}
<option name="fence_rhevm" value="fence_rhevm">RHEV-M fencing</option>
<option name="fence_ipmilan" value="fence_ipmilan">IPMI Lan</option>
- <option py:if="cluster_version == 2" name="fence_brocade" value="fence_brocade">Brocade Fabric Switch</option>
+ <option name="fence_brocade" value="fence_brocade">Brocade Fabric Switch</option>
<option py:if="cluster_version == 2" name="fence_lpar" value="fence_lpar">LPAR Fencing</option>
<option py:if="cluster_version == 2" name="fence_mcdata" value="fence_mcdata">McData SAN Switch</option>
13 years, 2 months
[luci] Add newly created files needed for expert mode
by Ryan McCabe
commit d66d8e96854b10fbbb435a44abaa9ca61990c002
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Tue Mar 15 19:45:55 2011 -0400
Add newly created files needed for expert mode
luci/lib/ClusterConf/Smb.py | 20 ++++++++++++++++++++
luci/public/js/user_prefs.js | 7 +++++++
luci/templates/prefs.html | 25 +++++++++++++++++++++++++
3 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/luci/lib/ClusterConf/Smb.py b/luci/lib/ClusterConf/Smb.py
new file mode 100644
index 0000000..da66d65
--- /dev/null
+++ b/luci/lib/ClusterConf/Smb.py
@@ -0,0 +1,20 @@
+# Copyright (C) 2006-2011 Red Hat, Inc.
+#
+# This program is free software; you can redistribute
+# it and/or modify it under the terms of version 2 of the
+# GNU General Public License as published by the
+# Free Software Foundation.
+
+from BaseResource import BaseResource
+from gettext import gettext as _
+
+# Old samba resource
+
+TAG_NAME = 'smb'
+RESOURCE_TYPE = _('Samba')
+
+class Smb(BaseResource):
+ def __init__(self):
+ BaseResource.__init__(self)
+ self.TAG_NAME = TAG_NAME
+ self.resource_type = RESOURCE_TYPE
diff --git a/luci/public/js/user_prefs.js b/luci/public/js/user_prefs.js
new file mode 100644
index 0000000..6f1bc18
--- /dev/null
+++ b/luci/public/js/user_prefs.js
@@ -0,0 +1,7 @@
+function update_user_mode(cb_obj) {
+ if ($(cb_obj).is(':checked')) {
+ $.cookie("expertMode", 1, {expires: 7});
+ } else {
+ $.cookie("expertMode", 0, {expires: 7});
+ }
+}
diff --git a/luci/templates/prefs.html b/luci/templates/prefs.html
new file mode 100644
index 0000000..c7889d3
--- /dev/null
+++ b/luci/templates/prefs.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<xi:include href="master.html"/>
+
+<head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
+ <title>User Preferences</title>
+</head>
+
+<body>
+ <script src="/js/jquery.cookie.js" type="text/javascript"></script>
+ <script src="/js/user_prefs.js" type="text/javascript"></script>
+ <div class="mainpage">
+ <h2>User Preferences</h2>
+ <input type="checkbox" class="checkbox" name="expert_mode"
+ py:attrs="expertMode and {'checked':'checked'} or {}"
+ onclick="update_user_mode(this)"/>
+ <label class="choice">Enable "expert" mode</label>
+ </div>
+</body>
+</html>
13 years, 2 months