Executes a subprocess, returning immediately. The process object is returned for later retrieval of the exit code etc.
(cmd)
| 50 | |
| 51 | |
| 52 | def exec_process_async(cmd): |
| 53 | """Executes a subprocess, returning immediately. The process object is returned for |
| 54 | later retrieval of the exit code etc. """ |
| 55 | LOG.debug('Executing: %s' % (cmd,)) |
| 56 | # Popen needs a list as its first parameter. The first element is the command, |
| 57 | # with the rest being arguments. |
| 58 | return Popen(shlex.split(cmd), shell=False, stdout=PIPE, stderr=PIPE, |
| 59 | universal_newlines=True) |
| 60 | |
| 61 | |
| 62 | def shell(cmd, cmd_prepend="set -euo pipefail\n", stdout=PIPE, stderr=STDOUT, |