From 6578c531ad2452134760038524bbc0b26efce319 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Fri, 2 Dec 2016 12:03:45 -0500 Subject: [PATCH] Remove deprecated dhcp_domain from dhcp_agent.ini The dhcp_domain value in dhcp_agent.ini value had been marked for deprecation in favor of using dns_domain in neutron.conf back in Liberty [1]. Remove it. [1] https://review.openstack.org/#/c/200952/ Change-Id: Iebde452559f88ca95713664136da1613cac9b32c Closes-bug: #1583769 --- neutron/agent/linux/dhcp.py | 12 ++++++------ neutron/conf/agent/dhcp.py | 7 ------- neutron/tests/unit/agent/linux/test_dhcp.py | 10 +++++----- .../notes/dhcp-domain-removed-cc5bc6e2129fdf7f.yaml | 5 +++++ 4 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/dhcp-domain-removed-cc5bc6e2129fdf7f.yaml diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py index c8d717dedff..41e43b5f4a9 100644 --- a/neutron/agent/linux/dhcp.py +++ b/neutron/agent/linux/dhcp.py @@ -400,8 +400,8 @@ class Dnsmasq(DhcpLocalProcess): for server in self.conf.dnsmasq_dns_servers: cmd.append('--server=%s' % server) - if self.conf.dhcp_domain: - cmd.append('--domain=%s' % self.conf.dhcp_domain) + if self.conf.dns_domain: + cmd.append('--domain=%s' % self.conf.dns_domain) if self.conf.dhcp_broadcast_reply: cmd.append('--dhcp-broadcast') @@ -591,8 +591,8 @@ class Dnsmasq(DhcpLocalProcess): hostname = 'host-%s' % alloc.ip_address.replace( '.', '-').replace(':', '-') fqdn = hostname - if self.conf.dhcp_domain: - fqdn = '%s.%s' % (fqdn, self.conf.dhcp_domain) + if self.conf.dns_domain: + fqdn = '%s.%s' % (fqdn, self.conf.dns_domain) yield (port, alloc, hostname, fqdn, no_dhcp, no_opts) def _get_port_extra_dhcp_opts(self, port): @@ -883,9 +883,9 @@ class Dnsmasq(DhcpLocalProcess): # dns-server submitted by the server subnet_index_map[subnet.id] = i - if self.conf.dhcp_domain and subnet.ip_version == 6: + if self.conf.dns_domain and subnet.ip_version == 6: options.append('tag:tag%s,option6:domain-search,%s' % - (i, ''.join(self.conf.dhcp_domain))) + (i, ''.join(self.conf.dns_domain))) gateway = subnet.gateway_ip host_routes = [] diff --git a/neutron/conf/agent/dhcp.py b/neutron/conf/agent/dhcp.py index 5889704b764..8433fb7c7bf 100644 --- a/neutron/conf/agent/dhcp.py +++ b/neutron/conf/agent/dhcp.py @@ -65,13 +65,6 @@ DHCP_OPTS = [ cfg.StrOpt('dhcp_confs', default='$state_path/dhcp', help=_('Location to store DHCP server config files.')), - cfg.StrOpt('dhcp_domain', - default='openstacklocal', - help=_('Domain to use for building the hostnames. ' - 'This option is deprecated. It has been moved to ' - 'neutron.conf as dns_domain. It will be removed ' - 'in a future release.'), - deprecated_for_removal=True), ] DNSMASQ_OPTS = [ diff --git a/neutron/tests/unit/agent/linux/test_dhcp.py b/neutron/tests/unit/agent/linux/test_dhcp.py index d43d7b44621..a6b56ee4fc2 100644 --- a/neutron/tests/unit/agent/linux/test_dhcp.py +++ b/neutron/tests/unit/agent/linux/test_dhcp.py @@ -1154,11 +1154,11 @@ class TestDnsmasq(TestBase): self.conf.set_override('dnsmasq_config_file', '/foo') self._test_spawn(['--conf-file=/foo', '--domain=openstacklocal']) - def test_spawn_no_dhcp_domain(self): + def test_spawn_no_dns_domain(self): (exp_host_name, exp_host_data, - exp_addn_name, exp_addn_data) = self._test_no_dhcp_domain_alloc_data - self.conf.set_override('dhcp_domain', '') - network = FakeDualNetwork(domain=self.conf.dhcp_domain) + exp_addn_name, exp_addn_data) = self._test_no_dns_domain_alloc_data + self.conf.set_override('dns_domain', '') + network = FakeDualNetwork(domain=self.conf.dns_domain) self._test_spawn(['--conf-file='], network=network) self.safe.assert_has_calls([mock.call(exp_host_name, exp_host_data), mock.call(exp_addn_name, exp_addn_data)]) @@ -1582,7 +1582,7 @@ class TestDnsmasq(TestBase): self._test_output_opts_file(expected, FakeV6Network()) @property - def _test_no_dhcp_domain_alloc_data(self): + def _test_no_dns_domain_alloc_data(self): exp_host_name = '/dhcp/cccccccc-cccc-cccc-cccc-cccccccccccc/host' exp_host_data = ('00:00:80:aa:bb:cc,host-192-168-0-2,' '192.168.0.2\n' diff --git a/releasenotes/notes/dhcp-domain-removed-cc5bc6e2129fdf7f.yaml b/releasenotes/notes/dhcp-domain-removed-cc5bc6e2129fdf7f.yaml new file mode 100644 index 00000000000..7faaccd0b53 --- /dev/null +++ b/releasenotes/notes/dhcp-domain-removed-cc5bc6e2129fdf7f.yaml @@ -0,0 +1,5 @@ +upgrade: + - The configuration option dhcp_domain in the + dhcp_agent.ini file was deprecated in the Liberty + cycle. This value is no longer supported, dns_domain + in neutron.conf should be used instead.