mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-23 22:55:23 +00:00
lxml conversion of get_info
This commit is contained in:
parent
b178bad93e
commit
9176cb6204
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue