From: Zack Cerza Date: Fri, 3 Feb 2023 19:54:44 +0000 (-0700) Subject: dispatcher: Log why we're stopping X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ef941861ebe373e2d875bd59572ae6c34bd8a043;p=teuthology.git dispatcher: Log why we're stopping Signed-off-by: Zack Cerza --- 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))