commit 03e1e5bc08a164dba333ed1fabba238e4d2ec136 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Sat May 2 09:04:11 2015 +0200
Add an `info` action returning some information about the specified action
pkgdb2client/admin.py | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) --- diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py index e34c7df..d63ffca 100644 --- a/pkgdb2client/admin.py +++ b/pkgdb2client/admin.py @@ -110,6 +110,15 @@ def setup_parser(): help='Identifier of the admin action to process.') parser_process.set_defaults(func=do_process)
+ # INFO + parser_info = subparsers.add_parser( + 'info', + help='Return a human-friendly description of the action') + parser_info.add_argument( + 'actionid', nargs='+', + help='Identifier of the admin action(s) of interest.') + parser_info.set_defaults(func=do_info) + return parser
@@ -167,6 +176,17 @@ def _action2msg(action): return msg
+def do_info(args): + ''' Returns some information about a specified action. + + ''' + for actionid in args.actionid: + LOG.info("action : {0}".format(actionid)) + action = PKGDBCLIENT.handle_api_call('/admin/action/%s' % actionid) + + print _action2msg(action) + + def do_list(args): ''' Retrieve the list of admin actions pending in pkgdb.
packagedb-cli-commits@lists.stg.fedorahosted.org