From a812167dc67e6888f61886ed2abda0b4e038bc4b Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Fri, 20 Dec 2019 23:40:46 +0100 Subject: [PATCH] Exit with libexec command return code --- cdist/libexec.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cdist/libexec.py b/cdist/libexec.py index 8aaa837f..bd22eb86 100644 --- a/cdist/libexec.py +++ b/cdist/libexec.py @@ -2,6 +2,7 @@ import os import os.path import cdist.argparse import subprocess +import sys libexec_delimiter = '-' @@ -38,4 +39,7 @@ def run(name, argv): lib_path = os.path.join(libexec_path, lib_name) args = [lib_path, ] args.extend(argv) - subprocess.check_call(args) + try: + subprocess.check_call(args) + except subprocess.CalledProcessError as e: + sys.exit(e.returncode)