Now params can be added in the plugin-action as list of params=value
Change-Id: Ifa6bfe06ea3953b23ad83f9f3bda214f114943e6
This commit is contained in:
parent
45892e0f9c
commit
8ed68cf8a6
@ -77,9 +77,20 @@ def do_plugin_remove(cc, args):
|
|||||||
@cliutils.arg('action',
|
@cliutils.arg('action',
|
||||||
metavar='<action>',
|
metavar='<action>',
|
||||||
help="action of the plugin.")
|
help="action of the plugin.")
|
||||||
|
@cliutils.arg(
|
||||||
|
'--params',
|
||||||
|
metavar='<parameter=value>',
|
||||||
|
nargs='+',
|
||||||
|
action='append',
|
||||||
|
default=[],
|
||||||
|
help="Parameters of the action")
|
||||||
def do_plugin_action(cc, args):
|
def do_plugin_action(cc, args):
|
||||||
|
params = {}
|
||||||
|
if args.params:
|
||||||
|
params = {k: v for k, v in (x.split('=') for x in args.params[0])}
|
||||||
|
|
||||||
result = cc.plugin_injection.plugin_action(args.board, args.plugin,
|
result = cc.plugin_injection.plugin_action(args.board, args.plugin,
|
||||||
args.action)
|
args.action, params)
|
||||||
print(_('%s') % result)
|
print(_('%s') % result)
|
||||||
|
|
||||||
|
|
||||||
@ -92,7 +103,10 @@ def do_plugins_on_board(cc, args):
|
|||||||
field_labels = res_fields.PLUGIN_INJECT_RESOURCE_ON_BOARD.labels
|
field_labels = res_fields.PLUGIN_INJECT_RESOURCE_ON_BOARD.labels
|
||||||
"""Show detailed information about a board."""
|
"""Show detailed information about a board."""
|
||||||
list = cc.plugin_injection.plugins_on_board(args.board)
|
list = cc.plugin_injection.plugins_on_board(args.board)
|
||||||
cliutils.print_list(list, fields=fields,
|
if list:
|
||||||
field_labels=field_labels,
|
cliutils.print_list(list, fields=fields,
|
||||||
sortby_index=None,
|
field_labels=field_labels,
|
||||||
json_flag=args.json)
|
sortby_index=None,
|
||||||
|
json_flag=args.json)
|
||||||
|
else:
|
||||||
|
print(_('%s') % 'no plugin could be found')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user