conga/luci/site/luci/Extensions ricci_bridge.py
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2006-11-20 23:30:47
Modified files:
luci/site/luci/Extensions: ricci_bridge.py
Log message:
return either true, false or none, depending on whether the node is virtual, not virtual, or we're unable to determine whether it's virtual, respectively
luci/site/luci/Extensions/ricci_bridge.py +9 -0
@@ -503,6 +503,15 @@ ricci_xml = rc.batch_run(batch_str) return batchAttemptResult(ricci_xml) +def nodeIsVirtual(rc): + batch_str = '<module name="cluster"><request API_version="1.0"><function_call name="virt_guest"/></request></module>' + + ricci_xml = rc.batch_run(batch_str, async=False) + if not ricci_xml or not ricci_xml.firstChild: + luci_log.debug_verbose('no ricci_xml in nodeIsVirtual') + return None + return ricci_xml.firstChild + def getDaemonStates(rc, dlist): batch_str = '<module name="service"><request API_version="1.0"><function_call name="query"><var mutable="false" name="search" type="list_xml">'