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

[Cluster-devel] conga/luci/site/luci/Extensions ricci_bridge.py



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe sourceware org	2006-10-31 13:51:54

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

Log message:
	fix non-async callers of batch_run to expect the first node to be '<?xml ...'

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

--- conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/31 13:16:30	1.38
+++ conga/luci/site/luci/Extensions/ricci_bridge.py	2006/10/31 13:51:53	1.39
@@ -279,7 +279,10 @@
 	batch_str ='<module name="cluster"><request API_version="1.0"><function_call name="status"/></request></module>'
 	ricci_xml = rc.batch_run(batch_str, async=False)
 
-	doc = getPayload(ricci_xml)
+	if not ricci_xml or not ricci_xml.firstChild:
+		luci_log.debug_verbose('ricci_xml is None from batch_run')
+		
+	doc = getPayload(ricci_xml.firstChild)
 	if not doc or not doc.firstChild:
 		luci_log.debug_verbose('doc is None from getPayload: %s' % ricci_xml.toxml())
 		return None
@@ -419,9 +422,10 @@
 	batch_str += '</var></function_call></request></module>'
 
 	ricci_xml = rc.batch_run(batch_str, async=False)
-	if not ricci_xml:
+	if not ricci_xml or not ricci_xml.firstChild:
+		luci_log.debug_verbose('no ricci_xml in getDaemonStates')
 		return None
-	result = extractDaemonInfo(ricci_xml)
+	result = extractDaemonInfo(ricci_xml.firstChild)
 	return result
 
 def extractDaemonInfo(bt_node):


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