From: Zack Cerza Date: Mon, 19 May 2014 22:45:26 +0000 (-0500) Subject: Rewrite list_locks() X-Git-Tag: 1.1.0~1245 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=533a5c5d8ccd6451a6559e0ec98f11e348074353;p=teuthology.git Rewrite list_locks() Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock.py b/teuthology/lock.py index 5db5408a13..f2dbd0355b 100644 --- a/teuthology/lock.py +++ b/teuthology/lock.py @@ -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