]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/lock: ignore none 200 jobs in node_job_is_active() 1167/head
authorKefu Chai <kchai@redhat.com>
Sun, 15 Apr 2018 23:56:05 +0000 (07:56 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 16 Apr 2018 00:09:39 +0000 (08:09 +0800)
there is chance that we will have 404 when accessing a job's URI.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/lock/query.py

index b6ef1cedbf5b21598b6b429c922deddbbd8aa6c0..2adf12e23f492f80a443cf024fe27c13f391926a 100644 (file)
@@ -123,6 +123,8 @@ def find_stale_locks(owner=None):
         url = os.path.join(config.results_server, 'runs', name, 'jobs', job_id,
                            '')
         resp = requests.get(url)
+        if not resp.ok:
+            return False
         job_info = resp.json()
         if job_info['status'] in ('running', 'waiting'):
             cache.add(description)
@@ -138,4 +140,4 @@ def find_stale_locks(owner=None):
         if node_job_is_active(node, active_jobs):
             continue
         result.append(node)
-    return result
\ No newline at end of file
+    return result