]> git.apps.os.sepia.ceph.com Git - teuthology.git/commit
lock.py: Add '--json-query' to allow complex search for --list/--brief 472/head
authorDan Mick <dan.mick@redhat.com>
Tue, 21 Apr 2015 03:35:56 +0000 (20:35 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 19 May 2015 18:03:42 +0000 (11:03 -0700)
commit7ec8fb7125f0d5d77d03826b969dc4d3c40c7b49
tree27cd4bdc41c61281008c320b346c6541b0bbad2b
parentcd13adb7acc6a282026879e3ecbcddfeff008596
lock.py: Add '--json-query' to allow complex search for --list/--brief

--json-query <file> or --json-query <string> allows filtering search
results conveniently; the JSON must be a dictionary that is a subset
of the lock record to be matched.  The reason this was invented:
Find all VPSes on a particular vmhost:

teuthology-lock --list --all --json-query \
'{"vm_host":{"name":"mira003.front.sepia.ceph.com"}}'

Signed-off-by: Dan Mick <dan.mick@redhat.com>
scripts/lock.py
teuthology/lock.py
teuthology/misc.py
teuthology/test/test_misc.py