From ef941861ebe373e2d875bd59572ae6c34bd8a043 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 3 Feb 2023 12:54:44 -0700 Subject: [PATCH] dispatcher: Log why we're stopping Signed-off-by: Zack Cerza --- teuthology/dispatcher/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 273f747e27..23cce7982b 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -40,8 +40,11 @@ def restart(): os.execv(sys.executable, args) -def stop(): - log.info('Stopping...') +def stop(reason=""): + msg = "Stopping..." + if reason: + msg = f"{reason}. {msg}" + log.info(msg) sys.exit(0) @@ -111,7 +114,7 @@ def main(args): if sentinel(restart_file_path): restart() elif sentinel(stop_file_path): - stop() + stop(f"{stop_file_path} was touched") load_config() job_procs = set(filter(lambda p: p.poll() is None, job_procs)) -- 2.39.5