From 1d7d733d017c0a8fe2f171d9822d752ff72d9fc6 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Tue, 30 Oct 2012 16:54:41 -0400 Subject: Use env to set environ when starting dnsmasq Explictly use env to setup needed environment variables for dnsmasq when starting to avoid problems with subprocess mis-interpreting the first command line argument as the executable name. Also update DnsmasqFilter to accept any command that starts with env followed by a set of args that include an equals sign, as long as the next arg is the dnsmasq command. fixes bug #1073253 Change-Id: I8ac08ba2d2309934a67ed2cb28049ed5d3277d63 --- nova/tests/test_nova_rootwrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/tests') diff --git a/nova/tests/test_nova_rootwrap.py b/nova/tests/test_nova_rootwrap.py index f67f2f56c..dc615bf5d 100644 --- a/nova/tests/test_nova_rootwrap.py +++ b/nova/tests/test_nova_rootwrap.py @@ -55,7 +55,7 @@ class RootwrapTestCase(test.TestCase): self.assertTrue(filtermatch is None) def test_DnsmasqFilter(self): - usercmd = ['FLAGFILE=A', 'NETWORK_ID=foobar', 'dnsmasq', 'foo'] + usercmd = ['env', 'FLAGFILE=A', 'NETWORK_ID=foobar', 'dnsmasq', 'foo'] f = filters.DnsmasqFilter("/usr/bin/dnsmasq", "root") self.assertTrue(f.match(usercmd)) self.assertEqual(f.get_command(usercmd), ['/usr/bin/dnsmasq', 'foo']) -- cgit