From c2f78e60218435acbea846a45bfe4096af0e99fe Mon Sep 17 00:00:00 2001 From: tengqm Date: Mon, 23 Nov 2015 09:42:37 -0500 Subject: [PATCH] Add 'global_project' option for cluster-list This patch adds an option '-g'/'--global-project' to the 'cluster-list' command so that an admin user can list clusters from all tenants/projects. Change-Id: I9fac64f1e81a6d4e61a93d57a1272d175e8b61e0 Depends-On: Icab38c970de7704c3134afd1b96a03b3670bd2ad --- senlinclient/v1/shell.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index ded40861..3975d105 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -514,6 +514,10 @@ def do_policy_delete(sc, args): @utils.arg('-m', '--marker', metavar='', help=_('Only return clusters that appear after the given cluster ' 'ID.')) +@utils.arg('-g', '--global-project', default=False, action="store_true", + help=_('Indicate that the cluster list should include clusters from' + ' all projects. This option is subject to access policy ' + 'checking. Default is False.')) @utils.arg('-F', '--full-id', default=False, action="store_true", help=_('Print full IDs in list.')) def do_cluster_list(sc, args=None): @@ -529,7 +533,8 @@ def do_cluster_list(sc, args=None): 'sort_keys': args.sort_keys, 'sort_dir': args.sort_dir, 'show_deleted': args.show_deleted, - 'show_nested': args.show_nested + 'show_nested': args.show_nested, + 'global_project': args.global_project, } if args.filters: queries.update(utils.format_parameters(args.filters))