From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 8 Feb 2007 05:05:23 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros cluster/resourc ... Message-ID: <20070208050523.29438.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: rmccabe at sourceware.org 2007-02-08 05:05:22 Modified files: luci/cluster : form-macros resource_form_handlers.js luci/homebase : luci_homebase.css luci/site/luci/Extensions: cluster_adapters.py Log message: Allow a failover domain to be selected for services Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.182&r2=1.183 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource_form_handlers.js.diff?cvsroot=cluster&r1=1.29&r2=1.30 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.38&r2=1.39 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.234&r2=1.235 --- conga/luci/cluster/form-macros 2007/02/08 03:42:58 1.182 +++ conga/luci/cluster/form-macros 2007/02/08 05:05:21 1.183 @@ -3920,6 +3920,18 @@ + + Failover Domain + + + + @@ -3945,6 +3957,7 @@ + @@ -4167,11 +4180,27 @@
- - + + + + + + + +
- Automatically start this service -
Automatically start this service +
Failover Domain + +
@@ -4195,6 +4224,7 @@ +
--- conga/luci/cluster/resource_form_handlers.js 2007/01/26 17:56:14 1.29 +++ conga/luci/cluster/resource_form_handlers.js 2007/02/08 05:05:21 1.30 @@ -423,6 +423,7 @@ var form_xml = ''; var svc_name = null; var autostart = 1; + var domain = null; var form = document.getElementsByTagName('form'); for (var i = 0 ; i < form.length ; i++) { @@ -437,6 +438,12 @@ } if (!form[i].autostart.checked) autostart = 0; + + if (form[i].domain) { + domain = form[i].domain.options[form[i].domain.options.selectedIndex].value; + if (str_is_blank(domain)) + domain = null; + } continue; } @@ -486,6 +493,8 @@ /* sort this out in the backend */ master_form.form_xml.value = '' + form_xml + ''; master_form.svc_name.value = svc_name; + if (domain) + master_form.domain.value = domain; master_form.autostart.value = autostart; var confirm_msg = null; --- conga/luci/homebase/luci_homebase.css 2007/02/07 17:18:43 1.38 +++ conga/luci/homebase/luci_homebase.css 2007/02/08 05:05:22 1.39 @@ -336,7 +336,6 @@ strong.cluster { text-align: top; font-size: 9pt; - letter-spacing: +.5px; } *.reshdr { @@ -350,7 +349,6 @@ strong.node_name, strong.cluster_name { font-size: 10pt; - letter-spacing: +.5px; } td.service_name, --- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/08 03:42:58 1.234 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/02/08 05:05:22 1.235 @@ -775,6 +775,14 @@ if len(errors) > 0: return (False, {'errors': errors}) + fdom = None + try: + fdom = request.form['domain'].strip() + if not fdom: + raise Exception, 'blank' + except: + fdom = None + try: service_name = request.form['svc_name'].strip() except Exception, e: @@ -827,6 +835,8 @@ new_service = Service() new_service.addAttribute('name', service_name) + if fdom: + new_service.addAttribute('domain', fdom) if autostart is not None: new_service.attr_hash['autostart'] = autostart @@ -3270,6 +3280,11 @@ baseurl = '/luci/cluster/index_html' try: + hmap['fdoms'] = map(lambda x: x.getName(), model.getFailoverDomains()) + except: + hmap['fdoms'] = list() + + try: cluname = req['clustername'] if not cluname: raise KeyError, 'is blank' @@ -3334,6 +3349,11 @@ #Now build hashes for resources under service. #first get service by name from model svc = model.getService(servicename) + try: + hmap['domain'] = svc.getAttribute('domain') + except: + hmap['domain'] = None + resource_list = list() if svc is not None: indent_ctr = 0 @@ -3357,9 +3377,11 @@ #Note: Final version needs all resource attrs if child.isRefObject() == True: rc_map['ref_object'] = True + rc_map['tag_name'] = child.getObj().TAG_NAME rc_map['type'] = child.getObj().getResourceType() rc_map['attrs'] = child.getObj().getAttributes() else: + rc_map['tag_name'] = child.TAG_NAME rc_map['type'] = child.getResourceType() rc_map['attrs'] = child.getAttributes()