summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dague <sdague@linux.vnet.ibm.com>2013-03-27 13:29:15 -0400
committerRussell Bryant <rbryant@redhat.com>2013-03-28 10:16:09 -0400
commit2a47b329da09e858c6dfe3c5860e2ee088a8a307 (patch)
treec95419f0f817902d34a31602080a291818ba2187
parent670c91c1bca836abb3a87127eaf3a54f0208ce4a (diff)
downloadnova-2a47b329da09e858c6dfe3c5860e2ee088a8a307.tar.gz
always quote dhcp-domain, otherwise dnsmasq can fail to start
the dnsmasq arg --dhcp-domain can't be passed to dnsmasq as empty (i.e. --dhcp-domain= ) unlike many other arguments. If you do pass it as empty, dnsmasq won't start, throwing a ProcessException which then crashes the rest of nova-network. Fix this by quoting dhcp-domain so that empty domains are allowed. Fixed bug #1161027 This was found by grenade upgrade testing Change-Id: Id24814339d8c8a709f5041f0aa98b10ba1e0e595 (cherry picked from commit 8d68ed3583df6ced4b4c8b6d6bb3569e03992cfe)
-rw-r--r--nova/network/linux_net.py2
-rw-r--r--nova/tests/network/test_linux_net.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/network/linux_net.py b/nova/network/linux_net.py
index f0173d47af..24babf1757 100644
--- a/nova/network/linux_net.py
+++ b/nova/network/linux_net.py
@@ -1015,7 +1015,7 @@ def restart_dhcp(context, dev, network_ref):
'--strict-order',
'--bind-interfaces',
'--conf-file=%s' % CONF.dnsmasq_config_file,
- '--domain=%s' % CONF.dhcp_domain,
+ '--domain=\'%s\'' % CONF.dhcp_domain,
'--pid-file=%s' % _dhcp_file(dev, 'pid'),
'--listen-address=%s' % network_ref['dhcp_server'],
'--except-interface=lo',
diff --git a/nova/tests/network/test_linux_net.py b/nova/tests/network/test_linux_net.py
index bd734bed31..ab8b00a929 100644
--- a/nova/tests/network/test_linux_net.py
+++ b/nova/tests/network/test_linux_net.py
@@ -504,7 +504,7 @@ class LinuxNetworkTestCase(test.TestCase):
'--strict-order',
'--bind-interfaces',
'--conf-file=%s' % CONF.dnsmasq_config_file,
- '--domain=%s' % CONF.dhcp_domain,
+ '--domain=\'%s\'' % CONF.dhcp_domain,
'--pid-file=%s' % linux_net._dhcp_file(dev, 'pid'),
'--listen-address=%s' % network_ref['dhcp_server'],
'--except-interface=lo',