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:
parent
3ba7091251
commit
8fb8b1b1e1
10
kas/shell.py
10
kas/shell.py
@ -24,8 +24,10 @@
|
|||||||
environment
|
environment
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import subprocess
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
from .libkas import kasplugin
|
from .libkas import kasplugin
|
||||||
from .context import create_global_context
|
from .context import create_global_context
|
||||||
from .config import Config
|
from .config import Config
|
||||||
@ -133,5 +135,7 @@ class ShellCommand(Command):
|
|||||||
if self.cmd:
|
if self.cmd:
|
||||||
cmd.append('-c')
|
cmd.append('-c')
|
||||||
cmd.append(self.cmd)
|
cmd.append(self.cmd)
|
||||||
subprocess.call(cmd, env=ctx.environ,
|
ret = subprocess.call(cmd, env=ctx.environ, cwd=ctx.build_dir)
|
||||||
cwd=ctx.build_dir)
|
if ret != 0:
|
||||||
|
logging.error('Shell returned non-zero exit status %d', ret)
|
||||||
|
sys.exit(ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user