From 983edb505067073d84a76f840ca339c9e5df81fe Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 16 Mar 2023 10:44:09 -0600 Subject: [PATCH] kill.kill_job: Tweak job status reporting Signed-off-by: Zack Cerza (cherry picked from commit 45117a8781ce6438f22140c00d05435c7781648b) --- teuthology/kill.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teuthology/kill.py b/teuthology/kill.py index a51e0fda35..c26432a3ca 100755 --- a/teuthology/kill.py +++ b/teuthology/kill.py @@ -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 -- 2.39.5