From c3bc181a8bc076543509d7422a13648461b77265 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Thu, 15 Apr 2021 02:09:20 +0200 Subject: [PATCH] SW-961: Log stderr but do not use it as output to parse. Unfortunately, slurm seems to give stderr output we occasionally have to ignore. If we need to ever check stderr, we may need a filter. --- MAC/Services/src/PipelineControl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MAC/Services/src/PipelineControl.py b/MAC/Services/src/PipelineControl.py index d9aa782a72d..abfab5bcc1b 100755 --- a/MAC/Services/src/PipelineControl.py +++ b/MAC/Services/src/PipelineControl.py @@ -102,15 +102,17 @@ def runCommand(cmdline, input=None): cmdline, stdin=subprocess.PIPE if input else None, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + stderr=subprocess.PIPE, shell=True, universal_newlines=True ) # Feed input and wait for termination logger.debug("runCommand input: %s", input) - stdout, _ = communicate_returning_strings(proc, input) + stdout, stderr = communicate_returning_strings(proc, input) logger.debug("runCommand output: %s", stdout) + if stderr: + logger.warn("runCommand stderr output: %s", stderr) # Check exit status, bail on error if proc.returncode != 0: -- GitLab