2 Various smaller helps for step execution.
7 LOG = logging.getLogger(__name__)
9 def run_script(cmd, **kwargs):
10 """ Run the given command, check that it is successful and output
13 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
15 (outp, outerr) = proc.communicate()
16 outp = outp.decode('utf-8')
17 outerr = outerr.decode('utf-8').replace('\\n', '\n')
18 LOG.debug("Run command: %s\n%s\n%s", cmd, outp, outerr)
20 assert proc.returncode == 0, "Script '{}' failed:\n{}\n{}\n".format(cmd[0], outp, outerr)