MCPcopy
hub / github.com/retspen/webvirtcloud / networks

Method networks

vrtManager/instance.py:212–223  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

210 return util.get_xml_path(net.XMLDesc(0), func=fixed)
211
212 def networks(ctx):
213 result = []
214 for net in ctx.xpathEval('/domain/devices/interface'):
215 mac_host = net.xpathEval('mac/@address')[0].content
216 nic_host = net.xpathEval('source/@network|source/@bridge|source/@dev|target/@dev')[0].content
217 try:
218 net = self.get_network(nic_host)
219 ip = get_mac_ipaddr(net, mac_host)
220 except:
221 ip = None
222 result.append({'mac': mac_host, 'nic': nic_host, 'ip': ip})
223 return result
224
225 return util.get_xml_path(self._XMLDesc(0), func=networks)
226

Callers

nothing calls this directly

Calls 1

get_networkMethod · 0.80

Tested by

no test coverage detected