Executes a subprocess, waiting for completion. The process exit code, stdout and stderr are returned as a tuple.
(cmd)
| 38 | |
| 39 | |
| 40 | def exec_process(cmd): |
| 41 | """Executes a subprocess, waiting for completion. The process exit code, stdout and |
| 42 | stderr are returned as a tuple.""" |
| 43 | LOG.debug('Executing: %s' % (cmd,)) |
| 44 | # Popen needs a list as its first parameter. The first element is the command, |
| 45 | # with the rest being arguments. |
| 46 | p = exec_process_async(cmd) |
| 47 | stdout, stderr = p.communicate() |
| 48 | rc = p.returncode |
| 49 | return rc, stdout, stderr |
| 50 | |
| 51 | |
| 52 | def exec_process_async(cmd): |