Created
May 16, 2014 21:12
-
-
Save lmacken/26520f6b9e1651dde231 to your computer and use it in GitHub Desktop.
Calculate the percentage of Fedora accounts that have package commit privileges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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