MCPcopy Create free account
hub / github.com/apache/cloudstack / get_vifs

Function get_vifs

scripts/vm/network/security_group.py:1212–1223  ·  view source on GitHub ↗
(vm_name)

Source from the content-addressed store, hash-verified

1210
1211
1212def get_vifs(vm_name):
1213 vifs = []
1214 xmlfile = virshdumpxml(vm_name)
1215 if not xmlfile:
1216 return vifs
1217
1218 dom = xml.dom.minidom.parseString(xmlfile)
1219 for network in dom.getElementsByTagName("interface"):
1220 target = network.getElementsByTagName('target')[0]
1221 nicdev = target.getAttribute("dev").strip()
1222 vifs.append(nicdev)
1223 return vifs
1224
1225
1226def get_vifs_for_bridge(vm_name, brname):

Callers 1

Calls 3

virshdumpxmlFunction · 0.85
getAttributeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected