[Cluster-devel] conga/luci cluster/form-macros site/luci/Exten ...

rmccabe at sourceware.org rmccabe at sourceware.org
Mon Mar 5 16:49:44 UTC 2007


CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL4
Changes by:	rmccabe at sourceware.org	2007-03-05 16:49:42

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=RHEL4&r1=1.176.2.14&r2=1.176.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.227.2.12&r2=1.227.2.13

--- conga/luci/cluster/form-macros	2007/02/28 21:42:22	1.176.2.14
+++ conga/luci/cluster/form-macros	2007/03/05 16:49:42	1.176.2.15
@@ -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)" />
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/03/01 20:22:31	1.227.2.12
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/03/05 16:49:42	1.227.2.13
@@ -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




More information about the Cluster-devel mailing list