conga/luci cluster/form-macros site/luci/Exten ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2007-03-05 16:50:09
Modified files:
luci/cluster : form-macros
luci/site/luci/Extensions: cluster_adapters.py
Log message:
Show cluster service start/relocate options for specific nodes on the main service list page Related: bz230466
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.90.2.19&r2=1.90.2.20
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.120.2.22&r2=1.120.2.23
luci/cluster/form-macros +2 -0
@@ -3915,6 +3915,8 @@ tal:condition="not: running" tal:attributes="value svc/delurl | nothing" tal:content="string:Delete this service" /> + <option value="">----------</option> + <option tal:repeat="starturl svc/links" tal:attributes="value starturl/url">Start this service on <span tal:replace="starturl/nodename"/></option> </select> <input type="button" value="Go" onclick="if (this.form.gourl[this.form.gourl.selectedIndex].value && confirm(this.form.gourl[this.form.gourl.selectedIndex].text + '?')) return dropdown(this.form.gourl)" />
luci/site/luci/Extensions/cluster_adapters.py +13 -1
@@ -3410,6 +3410,7 @@ baseurl = '/luci/cluster/index_html' try: + nodes = model.getNodes() cluname = req['clustername'] if not cluname: raise KeyError, 'is blank'
@@ -3426,9 +3427,11 @@ itemmap = {} itemmap['name'] = item['name'] + cur_node = None if item['running'] == "true": + cur_node = item['nodename'] itemmap['running'] = "true" - itemmap['nodename'] = item['nodename'] + itemmap['nodename'] = cur_node itemmap['disableurl'] = baseurl + "?" + "clustername=" + cluname +"&servicename=" + item['name'] + "&pagetype=" + SERVICE_STOP itemmap['restarturl'] = baseurl + "?" + "clustername=" + cluname +"&servicename=" + item['name'] + "&pagetype=" + SERVICE_RESTART else:
@@ -3436,6 +3439,15 @@ itemmap['autostart'] = item['autostart'] + starturls = list() + for node in nodes: + starturl = {} + if node.getName() != cur_node: + starturl['nodename'] = node.getName() + starturl['url'] = baseurl + '?' + 'clustername=' + cluname +'&servicename=' + item['name'] + '&pagetype=' + SERVICE_START + '&nodename=' + node.getName() + starturls.append(starturl) + itemmap['links'] = starturls + try: svc = model.retrieveServiceByName(item['name']) itemmap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + SERVICE