From ac43730889030fb0264c78964a59c8dbe52203f8 Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Mon, 8 May 2023 10:17:40 +0200 Subject: [PATCH] bail out on error in async command marked as fail When executing async commands, bail out in case the fail flag is set and a command returns a non zero exit code. This is required to ensure that further downstream commands are not executed as well. Previously, the execution continued till the first error of the command execution itself happened (e.g. command not found). Signed-off-by: Felix Moessbauer Signed-off-by: Jan Kiszka --- kas/libkas.py | 1 + 1 file changed, 1 insertion(+) diff --git a/kas/libkas.py b/kas/libkas.py index 68b92e5..ead6b72 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -156,6 +156,7 @@ async def run_cmd_async(cmd, cwd, env=None, fail=True, liveupdate=True): for line in logo.stderr: msg += line logging.error(msg) + raise CommandExecError(cmd, ret) return (ret, ''.join(logo.stdout))