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

Function get_bridges

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

Source from the content-addressed store, hash-verified

1241
1242
1243def get_bridges(vm_name):
1244 bridges = []
1245 xmlfile = virshdumpxml(vm_name)
1246 if not xmlfile:
1247 return bridges
1248
1249 dom = xml.dom.minidom.parseString(xmlfile)
1250 for network in dom.getElementsByTagName("interface"):
1251 for source in network.getElementsByTagName('source'):
1252 bridge = source.getAttribute("bridge").strip()
1253 bridges.append(bridge)
1254 return list(set(bridges))
1255
1256
1257def get_vm_id(vm_name):

Callers 1

Calls 3

virshdumpxmlFunction · 0.85
getAttributeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected