commit 1242967d43f3abe5a43901849d678daa6493de6d Author: Ryan McCabe rmccabe@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 ),