]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
dispatcher: Log why we're stopping
authorZack Cerza <zack@redhat.com>
Fri, 3 Feb 2023 19:54:44 +0000 (12:54 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 20 Feb 2023 20:08:03 +0000 (13:08 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/dispatcher/__init__.py

index 273f747e278ed30a3a44e7514e90a40501a6e15f..23cce7982bc519296a26aff0a5f4501efa433934 100644 (file)
@@ -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))