summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Dague <sdague@linux.vnet.ibm.com>2013-03-27 13:29:15 -0400
committerSean Dague <sdague@linux.vnet.ibm.com>2013-03-28 07:18:41 -0400
commit8d68ed3583df6ced4b4c8b6d6bb3569e03992cfe (patch)
treedd6a8f80712832906050137fa4485afdf8de0c6c
parent0bf532237382360666499e4c568f0a161ff31afe (diff)
downloadnova-8d68ed3583df6ced4b4c8b6d6bb3569e03992cfe.tar.gz
nova-8d68ed3583df6ced4b4c8b6d6bb3569e03992cfe.tar.xz
nova-8d68ed3583df6ced4b4c8b6d6bb3569e03992cfe.zip
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
-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 8d65b2c36..6230f8387 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 6aea1c93b..6c25741a6 100644
--- a/nova/tests/network/test_linux_net.py
+++ b/nova/tests/network/test_linux_net.py
@@ -503,7 +503,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',