Eliminate shell param from subprocesses in tests
Of the calls to execute a subprocess performed in tests, none of them require a shell. Test utility method was modified to not use a shell, eliminating a discouraged practice. Change-Id: If2571ee8f4ea2fdf6e14416d5abe5de275d3a1c4 Closes-Bug: 1348416
This commit is contained in:
parent
3445866403
commit
91f1396483
|
@ -282,13 +282,13 @@ def execute(cmd,
|
|||
path_ext = [os.path.join(os.getcwd(), 'bin')]
|
||||
|
||||
# Also jack in the path cmd comes from, if it's absolute
|
||||
executable = cmd.split()[0]
|
||||
args = shlex.split(cmd)
|
||||
executable = args[0]
|
||||
if os.path.isabs(executable):
|
||||
path_ext.append(os.path.dirname(executable))
|
||||
|
||||
env['PATH'] = ':'.join(path_ext) + ':' + env['PATH']
|
||||
process = subprocess.Popen(cmd,
|
||||
shell=True,
|
||||
process = subprocess.Popen(args,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
|
|
Loading…
Reference in New Issue