conga/luci/site/luci/Extensions ricci_bridge.py
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 ...'
luci/site/luci/Extensions/ricci_bridge.py +7 -3
@@ -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):