]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
lock: Avoid querying paddles for non-jobs 2002/head
authorZack Cerza <zack@redhat.com>
Thu, 29 Aug 2024 23:03:20 +0000 (17:03 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 29 Aug 2024 23:03:20 +0000 (17:03 -0600)
When we encounter a node that's locked with a description that doesn't look
like it points to a job, avoid the inevitable 404 we'd get from paddles. Without
this, the cleanup process gets short-circuited.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/lock/query.py

index 162f385726c96a3c9d74794b27316257a44bf84c..752eac106d533350ec195700b33d6860a482232d 100644 (file)
@@ -143,6 +143,10 @@ def node_active_job(name: str, status: Union[dict, None] = None) -> Union[str, N
         # This should never happen with a normal node
         return "node had no status"
     description = status['description']
+    if '/' not in description:
+        # technically not an "active job", but someone locked the node
+        # for a different purpose and is likely still using it.
+        return description
     (run_name, job_id) = description.split('/')[-2:]
     if not run_name or job_id == '':
         # We thought this node might have a stale job, but no.