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
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_DnsmasqFil ter(self) : ID=foobar' , 'dnsmasq', 'foo'] DnsmasqFilter( "/sbin/ dnsmasq: /usr/sbin/ dnsmasq: /usr/bin/ dnsmasq: /bin/dnsmasq" , "root")
self.assertTru e(f.match( usercmd) )
self.assertEqu al(f.get_ command( usercmd) , ['/usr/ bin/dnsmasq' , 'foo']) nt(usercmd)
self.assertEqu al(env. get('FLAGFILE' ), 'A')
self.assertEqu al(env. get('NETWORK_ ID'), 'foobar')
usercmd = ['env', 'FLAGFILE=A', 'NETWORK_
f = filters.
env = f.get_environme
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