From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 5 Mar 2007 16:50:11 -0000 Subject: [Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ... Message-ID: <20070305165011.5321.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 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 --- conga/luci/cluster/form-macros 2007/03/01 00:31:08 1.90.2.19 +++ conga/luci/cluster/form-macros 2007/03/05 16:50:09 1.90.2.20 @@ -3915,6 +3915,8 @@ tal:condition="not: running" tal:attributes="value svc/delurl | nothing" tal:content="string:Delete this service" /> + + --- conga/luci/site/luci/Extensions/cluster_adapters.py 2007/03/01 20:22:33 1.120.2.22 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2007/03/05 16:50:09 1.120.2.23 @@ -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