Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A script that prints out the packages that are ready to be signed
#!/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
You can’t perform that action at this time.