[Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ...

jparsons at sourceware.org jparsons at sourceware.org
Mon Oct 16 19:17:13 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons at sourceware.org	2006-10-16 19:17:13

Modified files:
	luci/site/luci/Extensions: cluster_adapters.py 
	                           conga_constants.py 

Log message:
	fenceinfo method

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.115&r2=1.116
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_constants.py.diff?cvsroot=cluster&r1=1.17&r2=1.18

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 15:18:32	1.115
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/16 19:17:13	1.116
@@ -907,6 +907,17 @@
   else:
     svadd['currentItem'] = False
 
+  if model.getIsVirtualized() == True:
+    vmadd = {}
+    vmadd['Title'] = "Add a XenVM"
+    vmadd['cfg_type'] = "xenvmadd"
+    vmadd['absolute_url'] = url + "?pagetype=" + XENVM_ADD + "&clustername=" + cluname
+    vmadd['Description'] = "Add a XenVM to this cluster"
+    if pagetype == XENVM_ADD:
+      vmadd['currentItem'] = True
+    else:
+      vmadd['currentItem'] = False
+
   svcfg = {}
   svcfg['Title'] = "Configure a Service"
   svcfg['cfg_type'] = "servicecfg"
@@ -922,6 +933,7 @@
     svcfg['currentItem'] = False
 
   services = model.getServices()
+  xenvms = model.getXENVMs()
   serviceable = list()
   for service in services:
     servicename = service.getName()
@@ -943,12 +955,36 @@
       svc['currentItem'] = False
 
     serviceable.append(svc)
+
+  for xenvm in xenvms:
+    xenname = xenvm.getName()
+    svc = {}
+    svc['Title'] = xenname
+    svc['cfg_type'] = "xenvm"
+    svc['absolute_url'] = url + "?pagetype=" + XENVM_CONFIG + "&servicename=" + xenname + "&clustername=" + cluname
+    svc['Description'] = "Configure this XenVM"
+    if pagetype == XENVM_CONFIG:
+      try:
+        xname = request['servicename']
+      except KeyError, e:
+        xname = ""
+      if xenname == xname:
+        svc['currentItem'] = True
+      else:
+        svc['currentItem'] = False
+    else:
+      svc['currentItem'] = False
+
+    serviceable.append(svc)
+
   svcfg['children'] = serviceable
 
 
 
   kids = list()
   kids.append(svadd)
+  if model.getIsVirtualized() == True:
+    kids.append(vmadd)
   kids.append(svcfg)
   sv['children'] = kids
 #############################################################
@@ -2322,6 +2358,17 @@
 
   return resultlist
 
+def getFence(self, model, request):
+  map = {}
+  fencename = request['fencedevicename']
+  fencedevs = model.getFenceDevices()
+  for fencedev in fencedevs:
+    if fencedev.getName().strip() == fencename:
+      map = fencedev.getAttributes()
+      return map
+
+  return map
+  
 def getFenceInfo(self, model, request):
   map = {}
   fencedevs = list() 
@@ -3362,6 +3409,8 @@
 			return False
 	return True
 
-def getModelBuilder(rc):
+def getModelBuilder(rc,isVirtualized):
 	cluster_conf_node = getClusterConf(rc)
-	return ModelBuilder(0, None, None, cluster_conf_node)
+	modelb = ModelBuilder(0, None, None, cluster_conf_node)
+  modelb.setIsVirtualized(isVirtualized)
+  return modelb
--- conga/luci/site/luci/Extensions/conga_constants.py	2006/10/16 04:26:19	1.17
+++ conga/luci/site/luci/Extensions/conga_constants.py	2006/10/16 19:17:13	1.18
@@ -13,6 +13,8 @@
 NODE_ADD="15"
 NODE_PROCESS="16"
 NODE_LOGS="17"
+XENVM_ADD="18"
+XENVM_CONFIG="19"
 SERVICES="20"
 SERVICE_ADD="21"
 SERVICE_LIST="22"
@@ -22,6 +24,7 @@
 SERVICE_START="26"
 SERVICE_STOP="27"
 SERVICE_RESTART="28"
+XENVM_PROCESS="29"
 RESOURCES="30"
 RESOURCE_ADD="31"
 RESOURCE_LIST="32"




More information about the Cluster-devel mailing list