]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
spawn_sol_log(): don't use the shell
authorZack Cerza <zack@redhat.com>
Thu, 25 Aug 2016 19:03:33 +0000 (13:03 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 31 Aug 2016 21:18:57 +0000 (15:18 -0600)
Shell usage is keeping the spawned command from terminating properly.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/console.py

index 0c02f048d70dc7bcf61ad21aedfbf4a37fcf02da..670e953286faa25e807236ea304d3054a0a45115 100644 (file)
@@ -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