Return cmd returncode from spoc-c exec

This commit is contained in:
Disassembler 2020-03-19 10:48:24 +01:00
parent fc42131bb6
commit 44c1a8638d
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499

View File

@ -4,6 +4,7 @@
import argparse
import os
import shlex
import sys
from spoc import repo_local
from spoc.config import VOLUMES_DIR
@ -96,7 +97,9 @@ def status(container_name):
def execute(container_name, command, uid, gid):
# Execute a command in container's namespace
Container(container_name).execute(command, uid, gid)
result = Container(container_name).execute(command, uid, gid)
# Set returncode to that of the command
sys.exit(result.returncode)
parser = argparse.ArgumentParser(description='SPOC container manager')
parser.set_defaults(action=None)