From 0eb59ef7c0d004bbdf54951f856dc1a71d1aec0b Mon Sep 17 00:00:00 2001 From: Mark McClain Date: Tue, 8 Dec 2015 11:58:15 -0500 Subject: [PATCH] Invert device_owner to avoid filtering too much In an earlier change[1], a filter was added to avoid Linuxbridge races with Nova. This filter breaks anything else using device owners other than n(eutron|etwork):. [1] https://review.openstack.org/#/c/193485/ Closes-Bug: #1524004 Closes-Bug: #1664659 Change-Id: I31a8e0e255b8b0251c991d5e20a4b9441d4ec489 (cherry picked from commit 1e95cfa98a12548b09a974c6db66d386f3b36d05) --- .../drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 2 +- .../linuxbridge/agent/test_linuxbridge_neutron_agent.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py index 8a1f19b9f08..bb2fe94e925 100644 --- a/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -476,7 +476,7 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase): return False # Avoid messing with plugging devices into a bridge that the agent # does not own - if device_owner.startswith(constants.DEVICE_OWNER_PREFIXES): + if not device_owner.startswith(constants.DEVICE_OWNER_COMPUTE_PREFIX): # Check if device needs to be added to bridge if not bridge_lib.BridgeDevice.get_interface_bridge( tap_device_name): diff --git a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py index 6f3a735e89c..46644076289 100644 --- a/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py +++ b/neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py @@ -510,13 +510,14 @@ class TestLinuxBridgeManager(base.BaseTestCase): p_const.TYPE_VLAN, "physnet1", None, "tap1", "foo") - def test_add_tap_interface_owner_other(self): + def test_add_tap_interface_owner_compute(self): with mock.patch.object(ip_lib, "device_exists"): with mock.patch.object(self.lbm, "ensure_local_bridge"): self.assertTrue(self.lbm.add_tap_interface("123", p_const.TYPE_LOCAL, "physnet1", None, - "tap1", "foo")) + "tap1", + "compute:1")) def _test_add_tap_interface(self, dev_owner_prefix): with mock.patch.object(ip_lib, "device_exists") as de_fn: