Support "global_project" arguments for action-list

In python-openstacksdk, senlin-api,senlin-engine layers,
"global_project" option has been support for action-list.
But in senlin client and db layer this hasn't been supported.
This patch Add "global_project" arguments for action-list in
senlinclient.

Depends-On: I064422a2b7058a1353206ab0978fe8ce0bffd732
Change-Id: Iaae58e8121e20789d072d5acbe28921ec255a8e0
This commit is contained in:
jonnary
2016-11-15 08:04:20 -08:00
committed by XueFeng Liu
parent f2d612903c
commit 86376d95df
4 changed files with 16 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ class TestActionList(TestAction):
]}
defaults = {
'global_project': False,
'marker': None,
'limit': None,
'sort': None,

View File

@@ -1612,6 +1612,7 @@ class ShellTest(testtools.TestCase):
'sort': 'status',
'limit': 20,
'marker': 'marker_id',
'global_project': True,
}
queries = copy.deepcopy(args)
args = self._make_args(args)

View File

@@ -58,6 +58,14 @@ class ListAction(command.Lister):
metavar='<id>',
help=_('Only return actions that appear after the given action ID')
)
parser.add_argument(
'--global-project',
default=False,
action="store_true",
help=_('Whether actions from all projects should be listed. '
' Default to False. Setting this to True may demand '
'for an admin privilege')
)
parser.add_argument(
'--full-id',
default=False,
@@ -78,6 +86,7 @@ class ListAction(command.Lister):
'sort': parsed_args.sort,
'limit': parsed_args.limit,
'marker': parsed_args.marker,
'global_project': parsed_args.global_project,
}
if parsed_args.filters:

View File

@@ -1500,6 +1500,10 @@ def do_event_show(service, args):
help=_('Limit the number of actions returned.'))
@utils.arg('-m', '--marker', metavar='<ID>',
help=_('Only return actions that appear after the given node ID.'))
@utils.arg('-g', '--global-project', default=False, action="store_true",
help=_('Whether actions from all projects should be listed. '
' Default to False. Setting this to True may demand '
'for an admin privilege.'))
@utils.arg('-F', '--full-id', default=False, action="store_true",
help=_('Print full IDs in list.'))
def do_action_list(service, args):
@@ -1512,6 +1516,7 @@ def do_action_list(service, args):
'sort': args.sort,
'limit': args.limit,
'marker': args.marker,
'global_project': args.global_project,
}
if args.filters: