Ensures that the dnsmasq configuration file flag is always set
Fixes bug 1094183 If the flag is not set then the default configuration file may be used. This may be problematic in certain setups. Change-Id: Ibd0be960779f391a198454510dd6edcbc69c149c
This commit is contained in:
parent
164db207fd
commit
72e3354690
@ -44,6 +44,7 @@ OPTS = [
|
||||
default='openstacklocal',
|
||||
help='Domain to use for building the hostnames'),
|
||||
cfg.StrOpt('dnsmasq_config_file',
|
||||
default='',
|
||||
help='Override the default dnsmasq settings with this file'),
|
||||
cfg.StrOpt('dnsmasq_dns_server',
|
||||
help='Use another DNS server before any in /etc/resolv.conf.'),
|
||||
@ -247,7 +248,6 @@ class Dnsmasq(DhcpLocalProcess):
|
||||
mode,
|
||||
self.conf.dhcp_lease_time))
|
||||
|
||||
if self.conf.dnsmasq_config_file:
|
||||
cmd.append('--conf-file=%s' % self.conf.dnsmasq_config_file)
|
||||
if self.conf.dnsmasq_dns_server:
|
||||
cmd.append('--server=%s' % self.conf.dnsmasq_dns_server)
|
||||
|
@ -434,7 +434,7 @@ class TestDnsmasq(TestBase):
|
||||
'dnsmasq-lease-update'),
|
||||
'--leasefile-ro',
|
||||
'--dhcp-range=set:tag0,192.168.0.0,static,120s',
|
||||
'--dhcp-range=set:tag1,fdca:3ba5:a17a:4ba3::,static,120s'
|
||||
'--dhcp-range=set:tag1,fdca:3ba5:a17a:4ba3::,static,120s',
|
||||
]
|
||||
expected.extend(extra_options)
|
||||
|
||||
@ -466,7 +466,7 @@ class TestDnsmasq(TestBase):
|
||||
check_exit_code=True)
|
||||
|
||||
def test_spawn(self):
|
||||
self._test_spawn([])
|
||||
self._test_spawn(['--conf-file='])
|
||||
|
||||
def test_spawn_cfg_config_file(self):
|
||||
self.conf.set_override('dnsmasq_config_file', '/foo')
|
||||
@ -474,7 +474,7 @@ class TestDnsmasq(TestBase):
|
||||
|
||||
def test_spawn_cfg_dns_server(self):
|
||||
self.conf.set_override('dnsmasq_dns_server', '8.8.8.8')
|
||||
self._test_spawn(['--server=8.8.8.8'])
|
||||
self._test_spawn(['--conf-file=', '--server=8.8.8.8'])
|
||||
|
||||
def test_output_opts_file(self):
|
||||
fake_v6 = 'gdca:3ba5:a17a:4ba3::1'
|
||||
|
Loading…
x
Reference in New Issue
Block a user