From: Zack Cerza Date: Thu, 25 Aug 2016 19:03:33 +0000 (-0600) Subject: spawn_sol_log(): don't use the shell X-Git-Tag: 1.1.0~537^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b6fa7a666cd3590ddf6bb7db4417c77a0127329;p=teuthology.git spawn_sol_log(): don't use the shell Shell usage is keeping the spawned command from terminating properly. Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 0c02f048d..670e95328 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -271,13 +271,15 @@ class PhysicalConsole(): pexpect_templ = \ "import pexpect; " \ "pexpect.run('{cmd}', logfile=file('{log}', 'w'), timeout=None)" - python_cmd = 'python -c "%s"' % pexpect_templ.format( - cmd=console_cmd, - log=dest_path, - ) + python_cmd = [ + '/usr/bin/env', 'python', '-c', + pexpect_templ.format( + cmd=console_cmd, + log=dest_path, + ), + ] proc = subprocess.Popen( python_cmd, - shell=True, env=os.environ, ) return proc