From: Kefu Chai Date: Sun, 15 Apr 2018 23:56:05 +0000 (+0800) Subject: teuthology/lock: ignore none 200 jobs in node_job_is_active() X-Git-Tag: 1.1.0~346^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1167%2Fhead;p=teuthology.git teuthology/lock: ignore none 200 jobs in node_job_is_active() there is chance that we will have 404 when accessing a job's URI. Signed-off-by: Kefu Chai --- diff --git a/teuthology/lock/query.py b/teuthology/lock/query.py index b6ef1cedb..2adf12e23 100644 --- a/teuthology/lock/query.py +++ b/teuthology/lock/query.py @@ -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