From: Mark McClain Date: Sat, 11 Aug 2012 15:29:14 +0000 (-0400) Subject: move the correct veth into the netns for the LB X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b45d4eb28025ecc604daf2bbdcd3ab450154f7d2;p=openstack-build%2Fneutron-build.git 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 --- 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()])