]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
find_stale_locks(): Only query locked nodes 663/head
authorZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 22:35:20 +0000 (16:35 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 20 Oct 2015 22:35:20 +0000 (16:35 -0600)
Simple performance oversight.

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

index b68b1ed8b32f94baf5e32f4db7173b9c99df9ee3..b332cdb13863b8837603fb57a247c9a42d1ce1ca 100644 (file)
@@ -591,7 +591,7 @@ def find_stale_locks(owner=None):
         return False
 
     # Which nodes are locked for jobs?
-    nodes = list_locks()
+    nodes = list_locks(locked=True)
     if owner is not None:
         nodes = [node for node in nodes if node['locked_by'] == owner]
     nodes = filter(might_be_stale, nodes)