From: Andreas Scheuring Date: Fri, 4 Dec 2015 07:35:28 +0000 (+0100) Subject: Cleanup veth-pairs in default netns for functional tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6ec16458fe430368e2479cf312bbe8a5a448e502;p=openstack-build%2Fneutron-build.git Cleanup veth-pairs in default netns for functional tests Today, veth-pairs created by the VethFixture of the net_helpers class are not cleanup on teardown. This is solved by this patch. Change-Id: I0a969e31e6694d74a9af6ada4e4e707c6332ffeb Closes-Bug: #1522710 --- diff --git a/neutron/tests/common/net_helpers.py b/neutron/tests/common/net_helpers.py index 21ae7d9c9..36316c217 100644 --- a/neutron/tests/common/net_helpers.py +++ b/neutron/tests/common/net_helpers.py @@ -419,7 +419,8 @@ class VethFixture(fixtures.Fixture): def destroy(self): for port in self.ports: ip_wrapper = ip_lib.IPWrapper(port.namespace) - if ip_wrapper.netns.exists(port.namespace): + if (ip_wrapper.netns.exists(port.namespace) or + port.namespace is None): try: ip_wrapper.del_veth(port.name) break