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

rmccabe at sourceware.org rmccabe at sourceware.org
Tue Oct 31 13:51:54 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	rmccabe at 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):




More information about the Cluster-devel mailing list