+ def get_node_element(self,hostname,network):
+ if network is not None:
+ xpath="//network[@name='%s']/node[@component_id[contains(., '%s')]]" % (network,hostname)
+ else: xpath="//node[@component_id[contains(., '%s')]]" % (hostname)
+ nodes=self.xml.xpath(xpath)
+ print 'found %d nodes'%len(nodes)
+ if nodes: return nodes[0]
+ else: return None
+