1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

lxml conversion of get_info

This commit is contained in:
catborise 2018-07-24 13:55:33 +03:00
parent b178bad93e
commit 9176cb6204

View file

@ -448,10 +448,12 @@ class wvmConnect(object):
def get_net_device(self):
netdevice = []
def get_info(ctx):
dev_type = util.get_xpath('/device/capability/@type')
interface = util.get_xpath('/device/capability/interface')
return (dev_type, interface)
def get_info(doc):
dev_type = util.get_xpath(doc, '/device/capability/@type')
interface = util.get_xpath(doc, '/device/capability/interface')
return dev_type, interface
for dev in self.wvm.listAllDevices(0):
xml = dev.XMLDesc(0)
(dev_type, interface) = util.get_xml_path(xml, func=get_info)