Merge "Invert device_owner to avoid filtering too much" into stable/ocata
This commit is contained in:
commit
9886bdaf1f
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue