diff --git a/heatclient/tests/test_shell.py b/heatclient/tests/test_shell.py index 1a933007..9b196e2e 100644 --- a/heatclient/tests/test_shell.py +++ b/heatclient/tests/test_shell.py @@ -397,6 +397,7 @@ class ShellTestUserPass(ShellBase): 'limit': 2, 'status': ['COMPLETE', 'FAILED'], 'marker': 'fake_id', + 'global_tenant': True }, True) fakes.script_heat_list(expected_url) @@ -406,7 +407,8 @@ class ShellTestUserPass(ShellBase): ' --limit 2' ' --marker fake_id' ' --filters=status=COMPLETE' - ' --filters=status=FAILED') + ' --filters=status=FAILED' + ' --global-tenant') required = [ 'teststack', diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 1ecc8803..f740eb2d 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -402,13 +402,19 @@ def do_list(hc, args=None): help='Limit the number of stacks returned.') @utils.arg('-m', '--marker', metavar='', help='Only return stacks that appear after the given stack ID.') +@utils.arg('-g', '--global-tenant', + action='store_true', + default=False, + help='Display stacks from all tenants. Operation only authorized ' + 'for users who match the policy in heat\'s policy.json.') def do_stack_list(hc, args=None): '''List the user's stacks.''' kwargs = {} if args: kwargs = {'limit': args.limit, 'marker': args.marker, - 'filters': utils.format_parameters(args.filters)} + 'filters': utils.format_parameters(args.filters), + 'global_tenant': args.global_tenant} stacks = hc.stacks.list(**kwargs) fields = ['id', 'stack_name', 'stack_status', 'creation_time']