From b45d4eb28025ecc604daf2bbdcd3ab450154f7d2 Mon Sep 17 00:00:00 2001 From: Mark McClain Date: Sat, 11 Aug 2012 11:29:14 -0400 Subject: [PATCH] move the correct veth into the netns for the LB bug 1035649 This fix moves the correct device into the namespace and improves the test to ensure the proper device was moved. The previous generic check failed to catch an error during refactoring. Change-Id: Ifa2e2bb97dc923549d00b1750c61a22e139647d7 --- quantum/agent/linux/interface.py | 2 +- quantum/tests/unit/test_linux_interface.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/agent/linux/interface.py b/quantum/agent/linux/interface.py index 03ed071df..b622d1e96 100644 --- a/quantum/agent/linux/interface.py +++ b/quantum/agent/linux/interface.py @@ -165,7 +165,7 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver): root_veth.link.set_address(mac_address) namespace = ip.ensure_namespace(network_id) - namespace.add_device_to_namespace(root_veth) + namespace.add_device_to_namespace(dhcp_veth) root_veth.link.set_up() dhcp_veth.link.set_up() diff --git a/quantum/tests/unit/test_linux_interface.py b/quantum/tests/unit/test_linux_interface.py index a9d9cd638..8de30e28a 100644 --- a/quantum/tests/unit/test_linux_interface.py +++ b/quantum/tests/unit/test_linux_interface.py @@ -178,7 +178,7 @@ class TestBridgeInterfaceDriver(TestBase): [mock.call('sudo'), mock.call().add_veth('tap0', 'dhc0'), mock.call().ensure_namespace('01234567-1234-1234-99'), - mock.call().ensure_namespace().add_device_to_namespace(mock.ANY)]) + mock.call().ensure_namespace().add_device_to_namespace(ns_veth)]) root_veth.assert_has_calls([mock.call.link.set_up()]) ns_veth.assert_has_calls([mock.call.link.set_up()]) -- 2.45.2