From f58d44f19080c697471054e1838eb707d9ffd5fb Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 7 Jul 2017 12:15:54 +0200 Subject: [PATCH] libkas: Properly format stderr dump of failing commands Inject the linefeed that we removed in f0a18868c9ce and add an introduction line. Signed-off-by: Jan Kiszka --- kas/libkas.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kas/libkas.py b/kas/libkas.py index dea799b..30c7c06 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -119,8 +119,10 @@ def run_cmd_async(cmd, cwd, env=None, fail=True, shell=False, liveupdate=True): if ret and fail: msg = 'Command "{cwd}$ {cmd}" failed'.format(cwd=cwd, cmd=cmdstr) - for line in logo.stderr: - msg += line + if logo.stderr: + msg += '\n--- Error summary ---\n' + for line in logo.stderr: + msg += line logging.error(msg) return (ret, ''.join(logo.stdout))