]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
list_locks must use 1 / 0 for True / False 542/head
authorLoic Dachary <ldachary@redhat.com>
Mon, 29 Jun 2015 13:54:08 +0000 (15:54 +0200)
committerLoic Dachary <ldachary@redhat.com>
Mon, 29 Jun 2015 23:18:10 +0000 (01:18 +0200)
Depending on the backend being used (sqlite or another), paddles won't
interpret locked=false as being the same as locked=0 (see
http://tracker.ceph.com/issues/12183 for more context).

Convert True to 1 and False to 0 to always get the same behavior from
paddles, regardless of the backend.

Signed-off-by: Loic Dachary <loic@dachary.org>
teuthology/lock.py

index 5f681064008c529e426ad2a31cf4fcfa3672bd60..eb0f202952789f34af23c7b7daa5504a2dc7adf9 100644 (file)
@@ -503,6 +503,11 @@ def unlock_one(ctx, name, user, description=None):
 
 def list_locks(keyed_by_name=False, **kwargs):
     uri = os.path.join(config.lock_server, 'nodes', '')
+    for key, value in kwargs.iteritems():
+        if kwargs[key] is False:
+            kwargs[key] = '0'
+        if kwargs[key] is True:
+            kwargs[key] = '1'
     if kwargs:
         if 'machine_type' in kwargs:
             kwargs['machine_type'] = kwargs['machine_type'].replace(',','|')