# HG changeset patch # User Goffi # Date 1605385180 -3600 # Node ID d7cfb031e41f5707cc7f4f4796cee96a3ee86902 # Parent 814e118d9ef33aa69c699551da8fc7825a512ae6 core (launcher): exit code can now specified Exit code can now be specified by setting the `_exitCode` variable in `twisted.application.app` module. diff -r 814e118d9ef3 -r d7cfb031e41f sat/core/launcher.py --- a/sat/core/launcher.py Thu Nov 12 14:53:16 2020 +0100 +++ b/sat/core/launcher.py Sat Nov 14 21:19:40 2020 +0100 @@ -23,7 +23,6 @@ import argparse from pathlib import Path from configparser import ConfigParser -from os.path import expanduser, join from twisted.application import app from twisted.python import usage from sat.core.constants import Const as C @@ -100,7 +99,7 @@ print(f"Still waiting for {self.APP_NAME} to be terminated…") elif state == 'waiting' and now - kill_started > 10: state == 'killing' - print(f"Waiting for too long, we kill the process") + print("Waiting for too long, we kill the process") os.kill(pid, signal.SIGKILL) sys.exit(1) @@ -233,6 +232,10 @@ runner.run() if runner._exitSignal is not None: app._exitWithSignal(runner._exitSignal) + try: + sys.exit(app._exitCode) + except AttributeError: + pass @classmethod def run(cls):