]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Use get_interface_bridge instead of get_bridge_for_tap_device
authorCedric Brandily <zzelle@gmail.com>
Thu, 5 Nov 2015 23:19:36 +0000 (00:19 +0100)
committerCedric Brandily <zzelle@gmail.com>
Mon, 9 Nov 2015 21:41:56 +0000 (22:41 +0100)
commitd3da15d62d4270dfb5a20e8d4051c7e17c8c2c9b
tree31db66d45a3e9278c038ff33b200f005bb49dedf
parent459980f04a62e2ef15a2b8c91ac6c8d6ee484167
Use get_interface_bridge instead of get_bridge_for_tap_device

bridge_lib defines get_interface_bridge which returns the bridge on
which an interface is connected (or None) where LB L2-agent[1] returns
it only if the bridge is a bridge managed by LB L2-agent.

According to get_bridge_for_tap_device 1st usage:

  if bridge_lib.is_bridged_interface(interface):
     bridge = self.get_bridge_for_tap_device(interface)
     bridge.delif(interface)

The code crashs if interface is owned by a non-LB-agent bridge because
the condition is verified but bridge is None.

[1] neutron.plugins.ml2.drivers.linuxbridge.agent.linuxbridge_neutron_agent

Partial-Bug: #1514548
Change-Id: If6dba1197b3f08ecc0ac01fcf085c8268f81169f
neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py