[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-02-02 04:34:35

Modified files:
	luci/cluster   : form-macros 
	luci/site/luci/Extensions: cluster_adapters.py 

Log message:
	Fix the display of virtual services

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.175&r2=1.176
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.226&r2=1.227

--- conga/luci/cluster/form-macros	2007/02/02 01:12:21	1.175
+++ conga/luci/cluster/form-macros	2007/02/02 04:34:35	1.176
@@ -3730,6 +3730,9 @@
 						href svc/cfgurl;
 						class python: 'cluster service ' + (running and 'running' or 'stopped')"
 						tal:content="svc/name" />
+					<tal:block tal:condition="exists:svc/virt">
+						(virtual service)
+					</tal:block>
 				</td>
 
 				<td class="cluster service service_action">
--- conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/02 00:11:05	1.226
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2007/02/02 04:34:35	1.227
@@ -2387,7 +2387,6 @@
     svcfg['currentItem'] = False
 
   services = model.getServices()
-  vms = model.getVMs()
   serviceable = list()
   for service in services:
     servicename = service.getName()
@@ -2410,6 +2409,7 @@
 
     serviceable.append(svc)
 
+  vms = model.getVMs()
   for vm in vms:
     name = vm.getName()
     svc = {}
@@ -3038,6 +3038,10 @@
 			vals['name'] = node.getAttribute('name')
 			vals['nodename'] = node.getAttribute('nodename')
 			vals['running'] = node.getAttribute('running')
+			try:
+				vals['is_vm'] = node.getAttribute('vm').lower() == 'true'
+			except:
+				vals['is_vm'] = False
 			vals['failed'] = node.getAttribute('failed')
 			vals['autostart'] = node.getAttribute('autostart')
 			results.append(vals)
@@ -3074,13 +3078,19 @@
 				itemmap['running'] = "true"
 				itemmap['nodename'] = item['nodename']
 			itemmap['autostart'] = item['autostart']
-			itemmap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + SERVICE
-			itemmap['delurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + SERVICE_DELETE
 
 			try:
 				svc = model.retrieveServiceByName(item['name'])
+				itemmap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + SERVICE
+				itemmap['delurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + SERVICE_DELETE
 			except:
-				continue
+				try:
+					svc = model.retrieveVMsByName(item['name'])
+					itemmap['virt'] = True
+					itemmap['cfgurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + VM_CONFIG 
+					itemmap['delurl'] = baseurl + "?" + "clustername=" + cluname + "&servicename=" + item['name'] + "&pagetype=" + VM_CONFIG
+				except:
+					continue
 			dom = svc.getAttribute("domain")
 			if dom is not None:
 				itemmap['faildom'] = dom
@@ -3667,7 +3677,12 @@
       svcname = svc['name']
       svc_dict['name'] = svcname
       svc_dict['srunning'] = svc['running']
-      svcurl = baseurl + "?" + PAGETYPE + "=" + SERVICE + "&" + CLUNAME + "=" + clustername + "&servicename=" + svcname
+
+      if svc.has_key('is_vm') and svc['is_vm'] is True:
+        target_page = VM_CONFIG
+      else:
+        target_page = SERVICE
+      svcurl = baseurl + "?" + PAGETYPE + "=" + target_page + "&" + CLUNAME + "=" + clustername + "&servicename=" + svcname
       svc_dict['servicename'] = svcname
       svc_dict['svcurl'] = svcurl
       svc_dict_list.append(svc_dict)


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