From: Zack Cerza Date: Thu, 16 Mar 2023 16:44:09 +0000 (-0600) Subject: kill.kill_job: Tweak job status reporting X-Git-Tag: 1.2.0~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1822%2Fhead;p=teuthology.git kill.kill_job: Tweak job status reporting Signed-off-by: Zack Cerza (cherry picked from commit 45117a8781ce6438f22140c00d05435c7781648b) --- diff --git a/teuthology/kill.py b/teuthology/kill.py index a51e0fda3..c26432a3c 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