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
This commit is contained in:
Brian Haley 2016-12-02 12:03:45 -05:00
parent 8ee5b3d45c
commit 6578c531ad
4 changed files with 16 additions and 18 deletions
neutron
agent/linux
conf/agent
tests/unit/agent/linux
releasenotes/notes

@ -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 = []

@ -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 = [

@ -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'

@ -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.