]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Rewrite list_locks()
authorZack Cerza <zack@cerza.org>
Mon, 19 May 2014 22:45:26 +0000 (17:45 -0500)
committerZack Cerza <zack.cerza@inktank.com>
Mon, 25 Aug 2014 17:14:36 +0000 (11:14 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/lock.py

index 5db5408a13bd8c4518b19c123ccc7f237380f5f9..f2dbd0355b81b27d3b070593ee7c62aa6e056c5a 100644 (file)
@@ -119,10 +119,14 @@ def unlock_one(ctx, name, user=None):
     return success
 
 
-def list_locks():
-    success, content, _ = ls.send_request('GET', config.lock_server)
+def list_locks(machine_type=None):
+    uri = os.path.join(config.lock_server, 'nodes', '')
+    if machine_type:
+        uri += '?machine_type=' + machine_type
+    response = requests.get(uri)
+    success = response.ok
     if success:
-        return json.loads(content)
+        return response.json()
     return None