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
This commit is contained in:
tengqm
2015-11-23 09:42:37 -05:00
parent fa8bc3f6e9
commit c2f78e6021

View File

@@ -514,6 +514,10 @@ def do_policy_delete(sc, args):
@utils.arg('-m', '--marker', metavar='<ID>',
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))