Enable query image by tag

This patch will enable Glance client to query images by user
defined tags.

Implement bp image-query-by-tag
Implement bp glance-client-v2

Change-Id: I6f54630c5b7c9c567d85485ad4289284e5486814
This commit is contained in:
Fei Long Wang
2013-08-11 11:02:32 +08:00
parent b6e117f151
commit 897ae3d795
4 changed files with 92 additions and 1 deletions
+3 -1
View File
@@ -28,9 +28,11 @@ from glanceclient import exc
help='Display images owned by <OWNER>.')
@utils.arg('--checksum', metavar='<CHECKSUM>',
help='Display images matching the checksum')
@utils.arg('--tag', metavar='<TAG>', action='append',
help="Filter images by an user-defined tag.")
def do_image_list(gc, args):
"""List images you can access."""
filter_keys = ['visibility', 'member_status', 'owner', 'checksum']
filter_keys = ['visibility', 'member_status', 'owner', 'checksum', 'tag']
filter_items = [(key, getattr(args, key)) for key in filter_keys]
filters = dict([item for item in filter_items if item[1] is not None])