shell: Propagate non-zero exit status

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Paul Barker 2020-05-19 10:45:17 +02:00 committed by Jan Kiszka
parent 3ba7091251
commit 8fb8b1b1e1

View File

@ -24,8 +24,10 @@
environment
"""
import subprocess
import logging
import os
import subprocess
import sys
from .libkas import kasplugin
from .context import create_global_context
from .config import Config
@ -133,5 +135,7 @@ class ShellCommand(Command):
if self.cmd:
cmd.append('-c')
cmd.append(self.cmd)
subprocess.call(cmd, env=ctx.environ,
cwd=ctx.build_dir)
ret = subprocess.call(cmd, env=ctx.environ, cwd=ctx.build_dir)
if ret != 0:
logging.error('Shell returned non-zero exit status %d', ret)
sys.exit(ret)