Skip to content

Instantly share code, notes, and snippets.

@lmacken
Created May 16, 2014 21:12
Show Gist options
  • Save lmacken/26520f6b9e1651dde231 to your computer and use it in GitHub Desktop.
Save lmacken/26520f6b9e1651dde231 to your computer and use it in GitHub Desktop.
Calculate the percentage of Fedora accounts that have package commit privileges
# Calculate the percentage of Fedora accounts that have package commit privileges
import os
import getpass
import pkgdb2client
from fedora.client import AccountSystem
pkgdb = pkgdb2client.PkgDB()
num_packagers = len(pkgdb.get_packagers('*')['packagers'])
fas = AccountSystem(username=os.getenv('USER'), password=getpass.getpass())
users = fas.user_data()
num_accounts = len(users)
print('%d users out of %d accounts have commit rights to at least one Fedora'
'package (%0.2f%%)' % (num_packagers, num_accounts, float(num_packagers) /
num_accounts * 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment