[Cluster-devel] conga/luci/site/luci/Extensions cluster_adapte ...
jparsons at sourceware.org
jparsons at sourceware.org
Sun Aug 13 18:36:02 UTC 2006
CVSROOT: /cvs/cluster
Module name: conga
Changes by: jparsons at sourceware.org 2006-08-13 19:36:02
Modified files:
luci/site/luci/Extensions: cluster_adapters.py
Log message:
address some shortcomings in nodeinfo
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.49&r2=1.50
--- conga/luci/site/luci/Extensions/cluster_adapters.py 2006/08/13 16:32:24 1.49
+++ conga/luci/site/luci/Extensions/cluster_adapters.py 2006/08/13 18:36:01 1.50
@@ -1487,6 +1487,11 @@
infohash = {}
baseurl = request['URL']
nodestate = NODE_ACTIVE
+ svclist = list()
+ for thing in status:
+ if thing['type'] == "service":
+ svclist.append(thing)
+
#Get cluster name and node name from request
clustername = request['clustername']
nodename = request['nodename']
@@ -1521,6 +1526,31 @@
infohash['reboot_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_REBOOT + "&nodename=" + nodename + "&clustername=" + clustername
infohash['fence_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_FENCE + "&nodename=" + nodename + "&clustername=" + clustername
infohash['delete_url'] = baseurl + "?pagetype=" + NODE_PROCESS + "&task=" + NODE_DELETE + "&nodename=" + nodename + "&clustername=" + clustername
+
+ #figure out current services running on this node
+ svc_dict_list = list()
+ for svc in svclist:
+ if svc['nodename'] == nodename:
+ svc_dict = {}
+ svcname = svc['name']
+ svcurl = baseurl + "?" + PAGETYPE + "=" + SERVICE + "&" + CLUNAME + "=" + clustername + "&servicename=" + svcname
+ svc_dict['servicename'] = svcname
+ svc_dict['svcurl'] = svcurl
+ svc_dict_list.append(svc_dict)
+
+ infohash['currentservices'] = svc_dict_list
+
+ #next is faildoms
+ fdoms = model.getFailoverDomainsForNode(nodename)
+ fdom_dict_list = list()
+ for fdom in fdoms:
+ fdom_dict = {}
+ fdom_dict['name'] = fdom.getName()
+ fdomurl = baseurl + "?" + PAGETYPE + "=" + FDOM_CONFIG + "&" + CLUNAME + "=" + clustername + "&fdomname=" + fdom.getName()
+ fdom_dict['fdomurl'] = fdomurl
+ fdom_dict_list.append(fdom_dict)
+
+ infohash['fdoms'] = fdom_dict_list
#return infohash
infohash['d_states'] = None
@@ -1616,7 +1646,7 @@
def getLogsForNode(self, request):
nodename = request['nodename']
clustername = request['clustername']
- nodename_resolved = resolve_nodename(clustername, nodename)
+ nodename_resolved = resolve_nodename(self, clustername, nodename)
#rb = ricci_bridge(nodename_resolved)
#return rb.getNodeLogs()
More information about the Cluster-devel
mailing list