]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
kill.kill_job: Tweak job status reporting 1822/head
authorZack Cerza <zack@redhat.com>
Thu, 16 Mar 2023 16:44:09 +0000 (10:44 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 16 Mar 2023 20:13:31 +0000 (14:13 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
(cherry picked from commit 45117a8781ce6438f22140c00d05435c7781648b)

teuthology/kill.py

index a51e0fda35c17b19dce40d5f4293b60fc89f3faa..c26432a3caec009c06b8570a8b8a448fffbe0592 100755 (executable)
@@ -87,7 +87,10 @@ def kill_job(run_name, job_id, archive_base=None, owner=None, skip_nuke=False):
         owner = job_info['owner']
     kill_processes(run_name, [job_info.get('pid')])
     if 'machine_type' in job_info:
-        teuthology.exporter.JobResults().record(job_info["machine_type"], job_info["status"])
+        teuthology.exporter.JobResults().record(
+            job_info["machine_type"],
+            job_info.get("status", "dead")
+        )
     else:
         log.warn(f"Job {job_id} has no machine_type; cannot report via Prometheus")
     # Because targets can be missing for some cases, for example, when all