From 65f4fc2fd3569d43fcff31114f8763e4b7907f6e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 17 Jan 2020 14:35:25 +0000 Subject: [PATCH] vif: Remove dead code We have had support for handling 'bridge' type VIFs with os-vif, via the '_nova_to_osvif_vif_bridge' helper, since the os-vif-library was first introduced in change Id78858bc55ce4f3f0727cad644ef9c8f9f718556. This means the legacy path is never executed, which has been proven in practice since this path references function that don't actually exist now ('nova.virt.libvirt.designer.set_vif_host_backend_bridge_config'). We should have spotted this when we removed the crazy getattr-based VIF lookup mechanism in change Idf08adca1e3a0d19e20bca2447c83f7372516cb7, but we didn't so do it now. Change-Id: Iaf1584112566a14807562fc46f7a70e526bbcbf0 Signed-off-by: Stephen Finucane --- nova/virt/libvirt/vif.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/nova/virt/libvirt/vif.py b/nova/virt/libvirt/vif.py index 5c3c479f7f12..f82368fcd028 100644 --- a/nova/virt/libvirt/vif.py +++ b/nova/virt/libvirt/vif.py @@ -289,23 +289,6 @@ class LibvirtGenericVIFDriver(object): return (("qvb%s" % iface_id)[:network_model.NIC_NAME_LEN], ("qvo%s" % iface_id)[:network_model.NIC_NAME_LEN]) - def get_config_bridge(self, instance, vif, image_meta, - inst_type, virt_type, host): - """Get VIF configurations for bridge type.""" - conf = self.get_base_config(instance, vif['address'], image_meta, - inst_type, virt_type, vif['vnic_type'], - host) - - designer.set_vif_host_backend_bridge_config( - conf, self.get_bridge_name(vif), - self.get_vif_devname(vif)) - - designer.set_vif_bandwidth_config(conf, inst_type) - - self._set_mtu_config(vif, host, conf) - - return conf - def _set_mtu_config(self, vif, host, conf): """:param vif: nova.network.modle.vif :param host: nova.virt.libvirt.host.Host @@ -608,8 +591,6 @@ class LibvirtGenericVIFDriver(object): args = (instance, vif, image_meta, inst_type, virt_type, host) if vif_type == network_model.VIF_TYPE_IOVISOR: return self.get_config_iovisor(*args) - elif vif_type == network_model.VIF_TYPE_BRIDGE: - return self.get_config_bridge(*args) elif vif_type == network_model.VIF_TYPE_802_QBG: return self.get_config_802qbg(*args) elif vif_type == network_model.VIF_TYPE_802_QBH: