]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Finally let L3 and DHCP agents cleanup namespaces by default
authorEugene Nikanorov <enikanorov@mirantis.com>
Wed, 22 Apr 2015 15:45:57 +0000 (19:45 +0400)
committerenikanorov <enikanorov@mirantis.com>
Fri, 1 May 2015 14:26:40 +0000 (14:26 +0000)
There has been a problem with iproute package that resulted in errors
when deleting the namespaces, so deleting was turned off by default.
According to tests with iproute version 3.12.0 there is no such issue
so the option could be safely turned on by default.

DocImpact
Related-Bug: #1052535
Related-Bug: #1402739

Change-Id: I4c831f98fb2462382ef0f9216e265555186b965a

etc/dhcp_agent.ini
etc/l3_agent.ini
neutron/agent/dhcp/config.py
neutron/agent/l3/config.py
neutron/tests/fullstack/config_fixtures.py
neutron/tests/functional/agent/test_l3_agent.py [changed mode: 0755->0644]
neutron/tests/unit/agent/l3/test_agent.py
neutron/tests/unit/agent/linux/test_dhcp.py

index 5b6c58ba1c01f7d1cbc491b2aee1e2bd08969c48..a0adccaaae6f236c90349fdcc32844f10ffc659e 100644 (file)
 # Use broadcast in DHCP replies
 # dhcp_broadcast_reply = False
 
-# dhcp_delete_namespaces, which is false by default, can be set to True if
-# namespaces can be deleted cleanly on the host running the dhcp agent.
-# Do not enable this until you understand the problem with the Linux iproute
-# utility mentioned in https://bugs.launchpad.net/neutron/+bug/1052535 and
-# you are sure that your version of iproute does not suffer from the problem.
-# If True, namespaces will be deleted when a dhcp server is disabled.
-# dhcp_delete_namespaces = False
+# dhcp_delete_namespaces, which is True by default, can be set to False if
+# namespaces can't be deleted cleanly on the host running the DHCP agent.
+# Disable this if you hit the issue in
+# https://bugs.launchpad.net/neutron/+bug/1052535 or if
+# you are sure that your version of iproute suffers from the problem.
+# dhcp_delete_namespaces = True
 
 # Timeout for ovs-vsctl commands.
 # If the timeout expires, ovs commands will fail with ALARMCLOCK error.
index 05f416cef67cb9d83334d39b48cff0074a5b7beb..0d56436bf8e98338fa5ff3a84ffad4744931ee4b 100644 (file)
 # Iptables mangle mark used to mark ingress from external network
 # external_ingress_mark = 0x2
 
-# router_delete_namespaces, which is false by default, can be set to True if
-# namespaces can be deleted cleanly on the host running the L3 agent.
-# Do not enable this until you understand the problem with the Linux iproute
-# utility mentioned in https://bugs.launchpad.net/neutron/+bug/1052535 and
-# you are sure that your version of iproute does not suffer from the problem.
+# router_delete_namespaces, which is True by default, can be set to False if
+# namespaces can't be deleted cleanly on the host running the L3 agent.
+# Disable this if you hit the issue in
+# https://bugs.launchpad.net/neutron/+bug/1052535 or if
+# you are sure that your version of iproute suffers from the problem.
 # If True, namespaces will be deleted when a router is destroyed.
-# router_delete_namespaces = False
+# router_delete_namespaces = True
 
 # Timeout for ovs-vsctl commands.
 # If the timeout expires, ovs commands will fail with ALARMCLOCK error.
index b8bb8c136495354e7315386d1df6375a29c99ba4..0cf60aa1f71bdad0e4a4ca3bd4f8b1cd0e1ba6e8 100644 (file)
@@ -49,7 +49,7 @@ DNSMASQ_OPTS = [
                 help=_('Comma-separated list of the DNS servers which will be '
                        'used as forwarders.'),
                 deprecated_name='dnsmasq_dns_server'),
-    cfg.BoolOpt('dhcp_delete_namespaces', default=False,
+    cfg.BoolOpt('dhcp_delete_namespaces', default=True,
                 help=_("Delete namespace after removing a dhcp server.")),
     cfg.IntOpt(
         'dnsmasq_lease_max',
index 46b248c2af66050101b7c9ed8d92f2a75f0ac480..98cfa3a88fc4e6cf765dd0fc31929a173009f738 100644 (file)
@@ -76,7 +76,7 @@ OPTS = [
                       "to the network and not through this parameter. ")),
     cfg.BoolOpt('enable_metadata_proxy', default=True,
                 help=_("Allow running metadata proxy.")),
-    cfg.BoolOpt('router_delete_namespaces', default=False,
+    cfg.BoolOpt('router_delete_namespaces', default=True,
                 help=_("Delete namespace after removing a router.")),
     cfg.StrOpt('metadata_access_mark',
                default='0x1',
index 6c25c9655073baf19b1e3aca3fc2ca79497e80b3..0936a3390f1e465fb184f2187c37ab9e74c29e33 100644 (file)
@@ -204,7 +204,6 @@ class L3ConfigFixture(ConfigFixture):
                                      'OVSInterfaceDriver'),
                 'ovs_integration_bridge': integration_bridge,
                 'external_network_bridge': self._generate_external_bridge(),
-                'router_delete_namespaces': 'True',
                 'debug': 'True',
                 'verbose': 'True',
             }
old mode 100755 (executable)
new mode 100644 (file)
index 629053b..127dfcc
@@ -83,7 +83,6 @@ class L3AgentTestFramework(base.BaseSudoTestCase):
         conf.set_override(
             'interface_driver',
             'neutron.agent.linux.interface.OVSInterfaceDriver')
-        conf.set_override('router_delete_namespaces', True)
 
         br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
         br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
index bdf62fbbd9909aa14bcc659161815566ab288678..058452ce9a8d49ea87a1297dc4e1331fd06564f6 100644 (file)
@@ -1941,6 +1941,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
         self.mock_ip.del_veth.assert_called_once_with('rfp-aaaa')
 
     def test_destroy_router_namespace_skips_ns_removal(self):
+        self.conf.set_override('router_delete_namespaces', False)
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
         ns = namespaces.Namespace(
             'qrouter-bar', self.conf, agent.driver, agent.use_ipv6)
@@ -1949,7 +1950,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
         self.assertEqual(self.mock_ip.netns.delete.call_count, 0)
 
     def test_destroy_router_namespace_removes_ns(self):
-        self.conf.set_override('router_delete_namespaces', True)
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
         ns = namespaces.Namespace(
             'qrouter-bar', self.conf, agent.driver, agent.use_ipv6)
@@ -2149,7 +2149,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
                                 other_namespaces,
                                 mock_snat_ns,
                                 mock_router_ns):
-        self.conf.set_override('router_delete_namespaces', True)
 
         good_namespace_list = [namespaces.NS_PREFIX + r['id']
                                for r in router_list]
@@ -2281,7 +2280,6 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
 
     def _test_external_gateway_removed_ext_gw_port_and_fip(self, fip_ns=False):
         self.conf.set_override('state_path', '/tmp')
-        self.conf.set_override('router_delete_namespaces', True)
 
         agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
         agent.conf.agent_mode = 'dvr_snat'
index fca35c1bb8b83ff0419fc927ca06d8b4a8ac8f6a..b9f349942a094a9b56e5d2187dcfd212b8cb6d36 100644 (file)
@@ -742,6 +742,7 @@ class TestDhcpLocalProcess(TestBase):
             self._assert_disabled(lp)
 
     def test_disable(self):
+        self.conf.set_override('dhcp_delete_namespaces', False)
         attrs_to_mock = dict([(a, mock.DEFAULT) for a in
                               ['active', 'interface_name']])
         network = FakeDualNetwork()
@@ -760,7 +761,6 @@ class TestDhcpLocalProcess(TestBase):
         self.assertEqual(ip.return_value.netns.delete.call_count, 0)
 
     def test_disable_delete_ns(self):
-        self.conf.set_override('dhcp_delete_namespaces', True)
         attrs_to_mock = {'active': mock.DEFAULT}
 
         with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks: