From 4eafec58f22a432b597ca9b23843bb79626481bc Mon Sep 17 00:00:00 2001 From: Itzik Brown Date: Tue, 21 Jul 2015 13:39:12 +0300 Subject: [PATCH] Adding a cleanup for 'qlbaas-' namespaces in netns_cleanup Change-Id: I2f8c2c037419953d6f6a9416472f4e5fb73d53db Closes-Bug: 1456151 --- neutron/cmd/netns_cleanup.py | 6 ++++-- neutron/tests/unit/cmd/test_netns_cleanup.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/neutron/cmd/netns_cleanup.py b/neutron/cmd/netns_cleanup.py index c2b74355f9d..8c54bbc44fd 100644 --- a/neutron/cmd/netns_cleanup.py +++ b/neutron/cmd/netns_cleanup.py @@ -36,10 +36,12 @@ from neutron.i18n import _LE LOG = logging.getLogger(__name__) -NS_MANGLING_PATTERN = ('(%s|%s|%s|%s)' % (dhcp.NS_PREFIX, +LB_NS_PREFIX = 'qlbaas-' +NS_MANGLING_PATTERN = ('(%s|%s|%s|%s|%s)' % (dhcp.NS_PREFIX, l3_agent.NS_PREFIX, dvr.SNAT_NS_PREFIX, - dvr_fip_ns.FIP_NS_PREFIX) + + dvr_fip_ns.FIP_NS_PREFIX, + LB_NS_PREFIX) + attributes.UUID_PATTERN) diff --git a/neutron/tests/unit/cmd/test_netns_cleanup.py b/neutron/tests/unit/cmd/test_netns_cleanup.py index 2da02c77f74..23eb2152c88 100644 --- a/neutron/tests/unit/cmd/test_netns_cleanup.py +++ b/neutron/tests/unit/cmd/test_netns_cleanup.py @@ -78,6 +78,9 @@ class TestNetnsCleanup(base.BaseTestCase): def test_eligible_for_deletion_fip_namespace(self): self._test_eligible_for_deletion_helper('fip-', False, True, True) + def test_eligible_for_deletion_lbaas_namespace(self): + self._test_eligible_for_deletion_helper('qlbaas-', False, True, True) + def test_eligible_for_deletion_snat_namespace(self): self._test_eligible_for_deletion_helper('snat-', False, True, True)