Comment 1 for bug 1079723

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Is this an option? Allow folks to enter one or more paths and get_command would return the right one for the OS?

    def test_DnsmasqFilter(self):
        usercmd = ['env', 'FLAGFILE=A', 'NETWORK_ID=foobar', 'dnsmasq', 'foo']
        f = filters.DnsmasqFilter("/sbin/dnsmasq:/usr/sbin/dnsmasq:/usr/bin/dnsmasq:/bin/dnsmasq", "root")
        self.assertTrue(f.match(usercmd))
        self.assertEqual(f.get_command(usercmd), ['/usr/bin/dnsmasq', 'foo'])
        env = f.get_environment(usercmd)
        self.assertEqual(env.get('FLAGFILE'), 'A')
        self.assertEqual(env.get('NETWORK_ID'), 'foobar')

Is "/sbin/dnsmasq:/usr/sbin/dnsmasq:/usr/bin/dnsmasq:/bin/dnsmasq" syntax ok for listing all the alternative locations where the executable may exist?

Or is the request more of, don't make me specify the executable, just look in all those hard coded paths and pick the first one?

thanks,
dims