mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-12-16 06:50:21 +00:00
On Unix, with shell=True, the shell default to /bin/sh. Using Popen(['type', command], shell=True) is equivalent to calling Popen(['/bin/sh', '-c', 'type', command]). In this case 'command' becomes a positional parameter to the shell, and not an argument to the command 'type'. The solution is to pass a single string as parameter. The problem is that with shell=True, we are never safe from a shell injection, so it is wiser to use a python only solution. The package distutils is part of the standard distribution, so it doesn't add extra dependencies. The method find_executable has the same behaviour as 'which' on bash. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| apt.py | ||
| boot.py | ||
| bootstrap.py | ||
| cleanup.py | ||
| development.py | ||
| extlinux.py | ||
| filesystem.py | ||
| folder.py | ||
| grub.py | ||
| host.py | ||
| image.py | ||
| initd.py | ||
| kernel.py | ||
| locale.py | ||
| loopback.py | ||
| network-configuration.yml | ||
| network.py | ||
| packages.py | ||
| partitioning.py | ||
| security.py | ||
| ssh.py | ||
| volume.py | ||
| workspace.py | ||