Exit with libexec command return code

This commit is contained in:
Darko Poljak 2019-12-20 23:40:46 +01:00
parent 7dddcb794b
commit a812167dc6

View file

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