libkas: Properly format stderr dump of failing commands

Inject the linefeed that we removed in f0a18868c9 and add an
introduction line.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2017-07-07 12:15:54 +02:00 committed by Daniel Wagner
parent eda4129b54
commit f58d44f190

View File

@ -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))