bootstrap-vz/bootstrapvz/common
Brendan Harley df3a200df3 Fix unfailing CheckExternalCommands
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.
2017-05-31 22:28:04 +02:00
..
assets Overhaul GCE image build. 2016-06-02 18:16:57 -07:00
fs Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
tasks Fix unfailing CheckExternalCommands 2017-05-31 22:28:04 +02:00
__init__.py PEP8 fixes 2014-04-27 11:05:53 -03:00
bytes.py Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
exceptions.py Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
fsm_proxy.py Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
minify_json.py Move code into proper package folder 2014-04-02 21:26:13 +02:00
phases.py common: Add a validation phase 2016-09-11 22:05:22 +02:00
releases.py Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
sectors.py Convert indentation from tabs to spaces (4) 2016-06-04 11:38:16 +02:00
task_groups.py Add handling for addtitional partitions 2016-12-10 16:11:58 +01:00
tools.py common.tools: Make rel_path normalize the path 2016-09-12 18:15:56 +02:00