Skip to contentSkip to conversation

conga/luci cluster/form-macros cluster/resourc ...

Cluster-devel [email protected] 1 participant 1 message Jan 20, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-01-20 04:50:20

Modified files:
luci/cluster : form-macros resource-form-macros
resource_form_handlers.js
luci/homebase : luci_homebase.css luci/site/luci/Extensions: Apache.py Clusterfs.py
FenceHandler.py Fs.py MySQL.py NFSExport.py Netfs.py OpenLDAP.py Postgres8.py Samba.py Script.py Tomcat5.py Vm.py cluster_adapters.py

Log message:
fence and resource fixes

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.155&r2=1.156
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Apache.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Clusterfs.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Fs.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/MySQL.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/NFSExport.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Netfs.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/OpenLDAP.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Postgres8.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Samba.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Script.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Tomcat5.py.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/Vm.py.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.207&r2=1.208

luci/cluster/form-macros +19 -19
@@ -1223,7 +1223,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 	</div>
@@ -1278,7 +1278,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1336,7 +1336,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1385,7 +1385,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1435,7 +1435,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1483,7 +1483,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1532,7 +1532,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1589,7 +1589,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1647,7 +1647,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1696,7 +1696,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1736,7 +1736,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1785,7 +1785,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1835,7 +1835,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1893,7 +1893,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1936,7 +1936,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1966,7 +1966,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -1997,7 +1997,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -2067,7 +2067,7 @@
 
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 
@@ -2094,7 +2094,7 @@
 		</table>
 		<tal:block tal:condition="exists: cur_fencedev">
 			<input type="hidden" name="existing_device" value="1" />
-			<input type="hidden" name="old_name"
+			<input type="hidden" name="orig_name"
 				tal:attributes="value cur_fencedev/name | nothing" />
 		</tal:block>
 		<input type="hidden" name="fence_type" value="fence_manual" />
luci/cluster/resource-form-macros +33 -9

73 lines not on this page · raw message

luci/cluster/resource_form_handlers.js +22 -11
@@ -99,23 +99,39 @@
 }
 
 function validate_apache(form) {
+	var errors = new Array();
+	return (errors);
 }
 
 function validate_tomcat5(form) {
+	var errors = new Array();
+	return (errors);
 }
 
 function validate_postgres8(form) {
+	var errors = new Array();
+	return (errors);
 }
 
 function validate_mysql(form) {
+	var errors = new Array();
+	return (errors);
 }
 
 function validate_openldap(form) {
+	var errors = new Array();
+	return (errors);
 }
 
 function validate_vm(form) {
+	var errors = new Array();
+	return (errors);
 }
 
+function validate_nfs_export(form) {
+	var errors = new Array();
+	return (errors);
+}
 
 function validate_nfs_mount(form) {
 	var errors = new Array();
@@ -140,11 +156,6 @@
 	return (errors);
 }
 
-function validate_nfs_export(form) {
-	var errors = new Array();
-	return (errors);
-}
-
 function validate_nfs_client(form) {
 	var errors = new Array();
 
@@ -231,12 +242,12 @@
 }
 
 var required_children = new Array();
-var required_children['nfsx'] = [ 'nfsc' ];
+required_children['nfsx'] = [ 'nfsc' ];
 
 var forbidden_children = new Array();
-var forbidden_children['ip'] = [ 'nfsc', 'nfsx' ];
-var forbidden_children['netfs'] = [ 'nfsc', 'nfsx' ];
-var forbidden_children['nfsx'] = [ 'nfsx' ];
+forbidden_children['ip'] = [ 'nfsc', 'nfsx' ];
+forbidden_children['netfs'] = [ 'nfsc', 'nfsx' ];
+forbidden_children['nfsx'] = [ 'nfsx' ];
 
 var form_validators = new Array();
 form_validators['ip'] = validate_ip;
@@ -249,8 +260,8 @@
 form_validators['smb'] = validate_samba;
 form_validators['vm'] = validate_vm;
 form_validators['apache'] = validate_apache;
-form_validators['tomcat-5'] validate_tomcat5;
-form_validators['postgres-8'] validate_postgres8;
+form_validators['tomcat-5'] = validate_tomcat5;
+form_validators['postgres-8'] = validate_postgres8;
 form_validators['openldap'] = validate_openldap;
 form_validators['mysql'] = validate_mysql;
 
luci/homebase/luci_homebase.css +1 -2
@@ -333,8 +333,7 @@
 
 *.reshdr {
 	text-align: top;
-	font-size: 9pt;
-	letter-spacing: +.5px;
+	font-size: 10pt;
 	font-weight: 600;
 	padding-bottom: +1em;
 }
luci/site/luci/Extensions/Apache.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "apache"
-RESOURCE_TYPE = _("Apache Server: ")
+RESOURCE_TYPE = _("Apache Server")
 
 class Apache(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/Clusterfs.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "clusterfs"
-RESOURCE_TYPE = _("GFS: ")
+RESOURCE_TYPE = _("GFS")
 
 class Clusterfs(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/FenceHandler.py +104 -110

274 lines not on this page · raw message

luci/site/luci/Extensions/Fs.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "fs"
-RESOURCE_TYPE = _("File System: ")
+RESOURCE_TYPE = _("File System")
 
 class Fs(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/MySQL.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "mysql"
-RESOURCE_TYPE = _("MySQL Server: ")
+RESOURCE_TYPE = _("MySQL Server")
 
 class MySQL(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/NFSExport.py +1 -1
@@ -5,7 +5,7 @@
 import gettext
 _ = gettext.gettext
 
-RESOURCE_TYPE = _("NFS Export: ")
+RESOURCE_TYPE = _("NFS Export")
 TAG_NAME = "nfsexport"
 
 class NFSExport(BaseResource):
luci/site/luci/Extensions/Netfs.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "netfs"
-RESOURCE_TYPE = _("NFS Mount: ")
+RESOURCE_TYPE = _("NFS Mount")
 
 class Netfs(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/OpenLDAP.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "openldap"
-RESOURCE_TYPE = _("Open LDAP Server: ")
+RESOURCE_TYPE = _("Open LDAP Server")
 
 class OpenLDAP(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/Postgres8.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "postgres-8"
-RESOURCE_TYPE = _("PostgreSQL 8 Server: ")
+RESOURCE_TYPE = _("PostgreSQL 8 Server")
 
 class Postgres8(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/Samba.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "smb"
-RESOURCE_TYPE = _("Samba Service: ")
+RESOURCE_TYPE = _("Samba Service")
 
 class Samba(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/Script.py +1 -1
@@ -5,7 +5,7 @@
 import gettext
 _ = gettext.gettext
 
-RESOURCE_TYPE = _("Script: ")
+RESOURCE_TYPE = _("Script")
 TAG_NAME = "script"
 
 class Script(BaseResource):
luci/site/luci/Extensions/Tomcat5.py +1 -1
@@ -6,7 +6,7 @@
 _ = gettext.gettext
 
 TAG_NAME = "tomcat-5"
-RESOURCE_TYPE = _("Tomcat 5 Server: ")
+RESOURCE_TYPE = _("Tomcat 5 Server")
 
 class Tomcat5(BaseResource):
   def __init__(self):
luci/site/luci/Extensions/Vm.py +9 -8
@@ -1,15 +1,16 @@
 import string
 from TagObject import TagObject
+from BaseResource import BaseResource
+
+import gettext
+_ = gettext.gettext
 
 TAG_NAME = "vm"
+RESOURCE_TYPE = _("Virtual Machine")
 
-class Vm(TagObject):
+class Vm(BaseResource):
   def __init__(self):
-    TagObject.__init__(self)
+    BaseResource.__init__(self)
     self.TAG_NAME = TAG_NAME
-    #Have autostart set by default
-    self.addAttribute("autostart","1")
-
-  def getProperties(self):
-    stringbuf = ""
-    return stringbuf
+    self.resource_type = RESOURCE_TYPE
+    self.addAttribute('autostart', '1')
luci/site/luci/Extensions/cluster_adapters.py +2 -4
@@ -30,7 +30,6 @@
 from clusterOS import resolveOSType
 from Fence import Fence
 from Method import Method
-from FenceDevice import FenceDevice
 from Device import Device
 from FenceHandler import validateNewFenceDevice, FENCE_OPTS, validateFenceDevice, validate_fenceinstance
 from GeneralError import GeneralError
@@ -1295,7 +1294,6 @@
     luci_log.debug_verbose('VFE: no form was submitted')
     return (False, {'errors': ['No form was submitted']})
 
-  #fencehandler = FenceHandler()
   error_code, retobj = validateNewFenceDevice(form, model)
   if error_code == FD_VAL_SUCCESS:
     try:
@@ -1304,7 +1302,7 @@
         raise Exception, 'conf_str is none'
     except Exception, e:
       luci_log.debug_verbose('VFE: export model as string failed: %s' \
-      % str(e))
+        % str(e))
       errors.append('Unable to store the new cluster configuration')
 
     try:
@@ -1643,7 +1641,7 @@
 			pass
 
 		for inst in instance_list:
-			retcode, retobj = validate_fenceinstance(inst, fencedev_name)
+			retcode, retobj = validate_fenceinstance(inst, fencedev_name, fence_type)
 			if retcode != FD_VAL_SUCCESS:
 				errors.extend(retobj)
 				continue