]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Better error handling in list_locks()
authorZack Cerza <zack.cerza@inktank.com>
Mon, 20 Oct 2014 15:58:25 +0000 (09:58 -0600)
committerZack Cerza <zack.cerza@inktank.com>
Mon, 20 Oct 2014 15:58:25 +0000 (09:58 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py

index b0055209428fea2a02cc5638429f33254276e27a..aebbd044078f283a6d99bd780805d4392963dadd 100644 (file)
@@ -449,6 +449,7 @@ def list_locks(keyed_by_name=False, **kwargs):
         response = requests.get(uri)
     except requests.ConnectionError:
         success = False
+        log.exception("Could not contact lock server: %s", config.lock_server)
     else:
         success = response.ok
     if success:
@@ -457,7 +458,7 @@ def list_locks(keyed_by_name=False, **kwargs):
         else:
             return {node['name']: node
                     for node in response.json()}
-    return None
+    return dict()
 
 
 def update_lock(name, description=None, status=None, ssh_pub_key=None):