Created
June 8, 2015 04:57
-
-
Save lmacken/c347fb739f279f6fba55 to your computer and use it in GitHub Desktop.
A script that prints out the packages that are ready to be signed
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
#!/usr/bin/python | |
""" | |
Print out a list of builds that need signing. | |
""" | |
__requires__ = 'bodhi' | |
import pkg_resources | |
import os | |
import sys | |
import pickle | |
from fedora.client import BodhiClient | |
bodhi = BodhiClient(base_url='http://localhost/updates/') | |
def signable_builds(release): | |
locked = set() | |
# Load the bodhi masher state | |
lock = '/mnt/koji/mash/updates/MASHING-%s' % release.id_prefix | |
if os.path.exists(lock): | |
state = pickle.load(file(lock)) | |
for update in state['updates']: | |
for build in update.split(','): | |
locked.add(build) | |
for req in ('stable', 'testing'): | |
updates = bodhi.query(request=req, release=release['name']) | |
for update in updates['updates']: | |
for build in update['builds']: | |
if build['nvr'] not in locked: | |
yield build['nvr'] | |
if __name__ == '__main__': | |
for release in bodhi.get_releases()['releases']: | |
for build in signable_builds(release): | |
print(build) | |
# vim: ts=4 sw=4 ai expandtab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment