From df4d738e31039d429c3e772feda76dbe8db9901b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 16 Apr 2018 07:56:05 +0800 Subject: [PATCH] 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 --- teuthology/lock/query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.3