Remove deprecated namespace deletion options

dhcp/router_delete_namespaces[1] options have been defined as a
workaround to an iproute2 limitation[1] corrected 2 years ago.

That's why the change removes these options after their deprecation
in Liberty.

[1] in neutron.agent.dhcp/l3.config

DocImpact
Closes-Bug: #1508189
Related-Bug: #1418079
Change-Id: I2a879213c3b095a007a4531f430a33cea9fdf1bd
This commit is contained in:
Cedric Brandily 2015-10-20 23:03:39 +02:00
parent 3854fd9af3
commit bd0e8af34c
10 changed files with 11 additions and 71 deletions

View File

@ -91,16 +91,6 @@
# Use broadcast in DHCP replies
# dhcp_broadcast_reply = 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.
# This should not be a problem any more. Refer to bug:
# https://bugs.launchpad.net/neutron/+bug/1418079
# This option is deprecated and will be removed in the M release
# dhcp_delete_namespaces = True
# Timeout for ovs-vsctl commands.
# If the timeout expires, ovs commands will fail with ALARMCLOCK error.
# ovs_vsctl_timeout = 10

View File

@ -91,17 +91,6 @@
# Iptables mangle mark used to mark ingress from external network
# external_ingress_mark = 0x2
# 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.
# This should not be a problem any more. Refer to bug:
# https://bugs.launchpad.net/neutron/+bug/1418079
# This option is deprecated and will be removed in the M release
# router_delete_namespaces = True
# Timeout for ovs-vsctl commands.
# If the timeout expires, ovs commands will fail with ALARMCLOCK error.
# ovs_vsctl_timeout = 10

View File

@ -55,11 +55,6 @@ 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=True,
help=_("Delete namespace after removing a dhcp server."
"This option is deprecated and "
"will be removed in a future release."),
deprecated_for_removal=True),
cfg.StrOpt('dnsmasq_base_log_dir',
help=_("Base log dir for dnsmasq logging. "
"The log contains DHCP and DNS log information and "

View File

@ -85,11 +85,6 @@ OPTS = [
'source.')),
cfg.BoolOpt('enable_metadata_proxy', default=True,
help=_("Allow running metadata proxy.")),
cfg.BoolOpt('router_delete_namespaces', default=True,
help=_("Delete namespace after removing a router."
"This option is deprecated and "
"will be removed in a future release."),
deprecated_for_removal=True),
cfg.StrOpt('metadata_access_mark',
default='0x1',
help=_('Iptables mangle mark used to mark metadata valid '

View File

@ -76,12 +76,11 @@ class Namespace(object):
ip_wrapper.netns.execute(cmd)
def delete(self):
if self.agent_conf.router_delete_namespaces:
try:
self.ip_wrapper_root.netns.delete(self.name)
except RuntimeError:
msg = _LE('Failed trying to delete namespace: %s')
LOG.exception(msg, self.name)
try:
self.ip_wrapper_root.netns.delete(self.name)
except RuntimeError:
msg = _LE('Failed trying to delete namespace: %s')
LOG.exception(msg, self.name)
class RouterNamespace(Namespace):

View File

@ -228,7 +228,7 @@ class DhcpLocalProcess(DhcpBase):
LOG.warning(_LW('Failed trying to delete interface: %s'),
self.interface_name)
if self.conf.dhcp_delete_namespaces and self.network.namespace:
if self.network.namespace:
ns_ip = ip_lib.IPWrapper(namespace=self.network.namespace)
try:
ns_ip.netns.delete(self.network.namespace)

View File

@ -30,7 +30,6 @@ class NamespaceManagerTestFramework(base.BaseSudoTestCase):
def setUp(self):
super(NamespaceManagerTestFramework, self).setUp()
self.agent_conf = mock.MagicMock()
self.agent_conf.router_delete_namespaces = True
self.metadata_driver_mock = mock.Mock()
self.namespace_manager = namespace_manager.NamespaceManager(
self.agent_conf, driver=None, clean_stale=True,

View File

@ -1718,16 +1718,7 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
'-bar')
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)
ns.create()
ns.delete()
self.assertEqual(0, self.mock_ip.netns.delete.call_count)
def test_destroy_router_namespace_removes_ns(self):
def test_destroy_router_namespace(self):
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
ns = namespaces.Namespace(
'qrouter-bar', self.conf, agent.driver, agent.use_ipv6)

View File

@ -103,9 +103,10 @@ class TestDvrFipNs(base.BaseTestCase):
dev2.name = 'fg-aaaa'
ip_wrapper.get_devices.return_value = [dev1, dev2]
self.conf.router_delete_namespaces = False
self.fip_ns.delete()
with mock.patch.object(self.fip_ns.ip_wrapper_root.netns,
'delete') as delete:
self.fip_ns.delete()
delete.assert_called_once_with(mock.ANY)
ext_net_bridge = self.conf.external_network_bridge
ns_name = self.fip_ns.get_name()

View File

@ -942,25 +942,6 @@ 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()
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks:
mocks['active'].__get__ = mock.Mock(return_value=True)
mocks['interface_name'].__get__ = mock.Mock(return_value='tap0')
lp = LocalChild(self.conf, network)
with mock.patch('neutron.agent.linux.ip_lib.IPWrapper') as ip:
lp.disable()
self._assert_disabled(lp)
self.mock_mgr.assert_has_calls([mock.call(self.conf, None),
mock.call().destroy(network, 'tap0')])
self.assertEqual(ip.return_value.netns.delete.call_count, 0)
def test_disable_delete_ns(self):
attrs_to_mock = {'active': mock.DEFAULT}
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks: