]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/kill.py: Fix "TypeError: string indices must be integers" fix-teuthology-kill
authorVallari Agrawal <val.agl002@gmail.com>
Wed, 12 Jun 2024 17:13:30 +0000 (22:43 +0530)
committerVallari Agrawal <val.agl002@gmail.com>
Wed, 12 Jun 2024 17:13:30 +0000 (22:43 +0530)
Fixes: https://tracker.ceph.com/issues/66440
Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
teuthology/kill.py

index bb5838c4f0c24afe42ba482c0280ec4ea3a91dc1..c78346fe2a2e99798e1c728fbf07d6286bbe81fe 100755 (executable)
@@ -74,7 +74,7 @@ def kill_run(run_name, archive_base=None, owner=None, machine_type=None,
         return
     if owner is not None:
         targets = find_targets(run_name)
-        names = [t["name"] for t in targets]
+        names = [t for t in targets]
         lock_ops.unlock_safe(names, owner, run_name)
     report.try_mark_run_dead(run_name)
 
@@ -233,11 +233,11 @@ def find_pids(run_name):
 def find_targets(run_name: str, job_id: Union[str, int, None] = None) -> dict:
     if job_id is not None:
         job_info = report.ResultsReporter().get_jobs(run_name, str(job_id))
-        return job_info.get("targets", dict())
+        return job_info.get("targets" or dict())
     result = dict()
     run_info = report.ResultsReporter().get_jobs(run_name)
     for job_info in run_info:
         if job_info.get("status") not in ("running", "waiting"):
             continue
-        result.update(job_info.get("targets", dict()))
+        result.update(job_info.get("targets") or dict())
     return result