[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2007-03-05 16:50:43

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&r1=1.195&r2=1.196
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.245&r2=1.246

--- conga/luci/cluster/form-macros	2007/02/28 21:54:05	1.195
+++ conga/luci/cluster/form-macros	2007/03/05 16:50:43	1.196
@@ -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:29	1.245
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/03/05 16:50:43	1.246
@@ -3412,6 +3412,7 @@
 		baseurl = '/luci/cluster/index_html'
 
 	try:
+		nodes = model.getNodes()
 		cluname = req['clustername']
 		if not cluname:
 			raise KeyError, 'is blank'
@@ -3428,9 +3429,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:
@@ -3438,6 +3441,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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]