Skip to content
This repository has been archived by the owner on Jul 24, 2018. It is now read-only.

Allow to process all admin requests #49

Merged
merged 2 commits into from Nov 20, 2015
Merged

Conversation

tyll
Copy link
Contributor

@tyll tyll commented Nov 16, 2015

No description provided.

@pypingou
Copy link
Member

hm we're doing two sets of changes in one commit here :/

One adding the filtering when listing, the other processing all the pending requests

for actionid in args.actionid:
args.status = "Awaiting Review"
if not args.actionid:
print 'Processing all requests with status: %s' % args.status
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we ask for a yes/no confirmation here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mo, Nov 16, 2015 at 10:38:53 -0800, Pierre-Yves Chibon wrote:

@@ -378,7 +389,14 @@ def do_process(args):
'''
LOG.info("user : {0}".format(args.username))

  • for actionid in args.actionid:
  • args.status = "Awaiting Review"
  • if not args.actionid:
  •    print 'Processing all requests with status: %s' % args.status
    

Should we ask for a yes/no confirmation here?

Since there will be a confirmation for each request, I do not think an
extra confirmation is needed here.

@tyll
Copy link
Contributor Author

tyll commented Nov 16, 2015

On Mo, Nov 16, 2015 at 10:37:04 -0800, Pierre-Yves Chibon wrote:

hm we're doing two sets of changes in one commit here :/

One adding the filtering when listing, the other processing all the pending requests

The filtering is a side effect, because do_list expects the args.package
and args.packager attributes:
https://github.com/fedora-infra/packagedb-cli/blob/master/pkgdb2client/admin.py#L205
https://github.com/fedora-infra/packagedb-cli/blob/master/pkgdb2client/admin.py#L208

Therefore the easiest way was to just add the arguments for filtering to
the process action as well.

@@ -378,7 +389,14 @@ def do_process(args):
'''
LOG.info("user : {0}".format(args.username))

for actionid in args.actionid:
args.status = "Awaiting Review"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should define this one within the if as it is not used otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good catch, I fixed it.

for cnt, action in enumerate(data['actions']):
print _action2msg(action)
ids.append(action["id"])

print 'Total: {0} actions'.format(cnt + 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems.. untrue. If zero actions are listed here, then it will print '1' action.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the second commit

@pypingou
Copy link
Member

Agreed, let's merge and make a release

@pypingou pypingou closed this Nov 20, 2015
@pypingou pypingou reopened this Nov 20, 2015
pypingou added a commit that referenced this pull request Nov 20, 2015
Allow to process all admin requests
@pypingou pypingou merged commit 97cef30 into fedora-infra:master Nov 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants