def clean_networks():
logging.debug('Cleaning all network config')
for network in constants.OPNFV_NETWORK_TYPES:
logging.info("Cleaning Jump Host Network config for network "
"{}".format(network))
jumphost.detach_interface_from_ovs(network)
jumphost.remove_ovs_bridge(network)
conn = libvirt.open('qemu:///system')
if not conn:
raise ApexCleanException('Unable to open libvirt connection')
logging.debug('Destroying all virsh networks')
for network in conn.listNetworks():
if network in constants.OPNFV_NETWORK_TYPES:
virsh_net = conn.networkLookupByName(network)
logging.debug("Destroying virsh network: {}".format(network))
if virsh_net.isActive():
virsh_net.destroy()
virsh_net.undefine()
评论列表
文章目录