Merge "Add stack tag filtering options to stack-list"

This commit is contained in:
Jenkins
2015-05-27 16:07:20 +00:00
committed by Gerrit Code Review
2 changed files with 24 additions and 0 deletions

View File

@@ -3483,6 +3483,10 @@ class MockShellTestUserPass(MockShellBase):
' --marker fake_id'
' --filters=status=COMPLETE'
' --filters=status=FAILED'
' --tags=tag1,tag2'
' --tags-any=tag3,tag4'
' --not-tags=tag5,tag6'
' --not-tags-any=tag7,tag8'
' --global-tenant'
' --show-deleted'
' --show-hidden')
@@ -3506,6 +3510,10 @@ class MockShellTestUserPass(MockShellBase):
expected_query_dict = {'limit': ['2'],
'status': ['COMPLETE', 'FAILED'],
'marker': ['fake_id'],
'tags': ['tag1,tag2'],
'tags_any': ['tag3,tag4'],
'not_tags': ['tag5,tag6'],
'not_tags_any': ['tag7,tag8'],
'global_tenant': ['True'],
'show_deleted': ['True'],
'show_hidden': ['True']}

View File

@@ -517,6 +517,18 @@ def do_stack_cancel_update(hc, args):
'This can be specified multiple times, or once with parameters '
'separated by a semicolon.'),
action='append')
@utils.arg('-t', '--tags', metavar='<TAG1,TAG2...>',
help=_('Show stacks containing these tags, combine multiple tags '
'using the boolean AND expression'))
@utils.arg('--tags-any', metavar='<TAG1,TAG2...>',
help=_('Show stacks containing these tags, combine multiple tags '
'using the boolean OR expression'))
@utils.arg('--not-tags', metavar='<TAG1,TAG2...>',
help=_('Show stacks not containing these tags, combine multiple '
'tags using the boolean AND expression'))
@utils.arg('--not-tags-any', metavar='<TAG1,TAG2...>',
help=_('Show stacks not containing these tags, combine multiple '
'tags using the boolean OR expression'))
@utils.arg('-l', '--limit', metavar='<LIMIT>',
help=_('Limit the number of stacks returned.'))
@utils.arg('-m', '--marker', metavar='<ID>',
@@ -535,6 +547,10 @@ def do_stack_list(hc, args=None):
kwargs = {'limit': args.limit,
'marker': args.marker,
'filters': utils.format_parameters(args.filters),
'tags': args.tags,
'tags_any': args.tags_any,
'not_tags': args.not_tags,
'not_tags_any': args.not_tags_any,
'global_tenant': args.global_tenant,
'show_deleted': args.show_deleted,
'show_hidden': args.show_hidden}