From c5b60376dcde17573345e7aba4f1cddd54719049 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 1 Apr 2015 17:30:48 -0600 Subject: [PATCH] Be slightly smarter when looking for stale locks Signed-off-by: Zack Cerza --- teuthology/lock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teuthology/lock.py b/teuthology/lock.py index a11e6f93e6..f1e0676835 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -492,9 +492,10 @@ def find_stale_locks(owner=None): ... because we really want "nodes that were locked for a particular job and are still locked" and the above is currently the best way to guess. """ + desc = node_dict['description'] if (node_dict['locked'] is True and - node_dict['description'] is not None and - node_dict['description'].count('/') > 1): + desc is not None and desc.startswith('/') and + desc.count('/') > 1): return True return False -- 2.39.5