commit 305c9e83a5defb3541a40ea489ae1c7ad9b04a28 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Fri Oct 10 12:31:59 2014 +0200
Implement the interactive process for new branch
pkgdb2client/admin.py | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 40 insertions(+), 6 deletions(-) --- diff --git a/pkgdb2client/admin.py b/pkgdb2client/admin.py index a8f8e6d..3e675ca 100644 --- a/pkgdb2client/admin.py +++ b/pkgdb2client/admin.py @@ -288,14 +288,48 @@ def do_process(args): )
elif action['action'] == 'request.branch': - data = pkgdbclient.update_acl( - pkgname=action['package']['name'], - branches=action['collection']['branchname'], - acls=['commit', 'watchbugzilla', 'watchcommits', 'approveacls'], - status='Approved', - user=action['user'], + msgs = utils.check_branch_creation( + pkgdbclient, + action['package']['name'], + action['collection']['branchname'], + action['user'] )
+ decision = _ask_what_to_do(msgs) + if decision == 'pass': + data = { + 'messages': ['Action {0} un-touched'.format(args.actionid)] + } + + elif decision == 'deny': + data = pkgdbclient.handle_api_call( + '/admin/action/status', + data={ + 'id': args.actionid, + 'status': 'Denied' + } + ) + + else: + data = pkgdbclient.update_acl( + pkgname=action['package']['name'], + branches=action['collection']['branchname'], + acls=[ + 'commit', 'watchbugzilla', + 'watchcommits', 'approveacls' + ], + status='Approved', + user=action['user'], + ) + + pkgdbclient.handle_api_call( + '/admin/action/status', + data={ + 'id': args.actionid, + 'status': 'Approved' + } + ) + else: print 'Action %s not supported by pkgdb-cli' % action['action']
packagedb-cli-commits@lists.stg.fedorahosted.org