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

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



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	jparsons sourceware org	2006-10-11 22:37:28

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

Log message:
	resolver fix

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.94&r2=1.95

--- conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/11 20:58:13	1.94
+++ conga/luci/site/luci/Extensions/cluster_adapters.py	2006/10/11 22:37:28	1.95
@@ -2198,7 +2198,11 @@
 def getLogsForNode(self, request):
   nodename = request['nodename']
   clustername = request['clustername']
-  nodename_resolved = resolve_nodename(self, clustername, nodename)
+  try:
+    nodename_resolved = resolve_nodename(self, clustername, nodename)
+  except:
+    return "Unable to resolve node name %s to retrieve logging information" % nodename
+
   rb = ricci_bridge(nodename_resolved)
   return rb.getNodeLogs()
 
@@ -2334,7 +2338,14 @@
 	except:
 		return {}
 
-	ricci_agent = resolve_nodename(self, clustername, ragent)
+  try:
+	  ricci_agent = resolve_nodename(self, clustername, ragent)
+  except:
+    map = {}
+    map['os'] = ""
+    map['isVirtualized'] = False
+    return map
+
 	rc = RicciCommunicator(ricci_agent)
 	map = {}
 	os_str = resolveOSType(rc.os())
@@ -2921,12 +2932,12 @@
 def resolve_nodename(self, clustername, nodename):
   path = CLUSTER_FOLDER_PATH + clustername
   clusterfolder = self.restrictedTraverse(path)
-  objs = clusterfolder.objectItems()
+  objs = clusterfolder.objectItems('Folder')
   for obj in objs:
     if obj[0].find(nodename) != (-1):
       return obj[0]
 
-  return None
+  raise
 
 def noNodeFlagsPresent(self, nodefolder, flagname, hostname):
   items = nodefolder.objectItems()


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