bodhi/tools/tagcheck.py | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
New commits: commit b6bb23e0c25a3afc4c593e339696593ee057671c Author: Luke Macken lmacken@redhat.com Date: Sat Dec 13 18:55:10 2008 -0500
Improve our bodhi-tagcheck script to work against all releases
diff --git a/bodhi/tools/tagcheck.py b/bodhi/tools/tagcheck.py index 625fe29..e0f05f3 100755 --- a/bodhi/tools/tagcheck.py +++ b/bodhi/tools/tagcheck.py @@ -9,7 +9,7 @@ from sqlobject import SQLObjectNotFound from turbogears.database import PackageHub
from bodhi.util import load_config -from bodhi.model import PackageBuild, PackageUpdate +from bodhi.model import PackageBuild, PackageUpdate, Release from bodhi.buildsys import get_session
def main(): @@ -26,7 +26,8 @@ def main(): tags)
# Check all candidate updates to see if they are in a different bodhi state - for tag in ('dist-f9-updates-candidate', 'dist-f8-updates-candidate'): + for release in Release.select(): + tag = '%s-updates-candidate' % release.dist_tag tagged = [build['nvr'] for build in koji.listTagged(tag)] for nvr in tagged: try: @@ -41,22 +42,23 @@ def main():
# Make sure that all builds in koji tagged as an update exist # in bodhi, and are in the expect state. - for tag in ('dist-f9-updates-testing', 'dist-f9-updates', - 'dist-f8-updates-testing', 'dist-f8-updates'): - tagged = [build['nvr'] for build in koji.listTagged(tag)] - for nvr in tagged: - try: - build = PackageBuild.byNvr(nvr) - except SQLObjectNotFound: - print "PackageUpdate(%s) not found!" % nvr - continue - if not len(build.updates): - print "PackageBuild(%s) has no updates" % (build.nvr) - status = 'testing' in tag and 'testing' or 'stable' - for update in build.updates: - if update.status != status: - print "%s is %s in bodhi but tagged as %s in koji" % ( - update.title, update.status, tag) + for release in Release.select(): + for update_tag in ('updates-testing', 'updates'): + tag = '%s-%s' % (release.dist_tag, update_tag) + tagged = [build['nvr'] for build in koji.listTagged(tag)] + for nvr in tagged: + try: + build = PackageBuild.byNvr(nvr) + except SQLObjectNotFound: + print "PackageUpdate(%s) not found!" % nvr + continue + if not len(build.updates): + print "PackageBuild(%s) has no updates" % (build.nvr) + status = 'testing' in tag and 'testing' or 'stable' + for update in build.updates: + if update.status != status: + print "%s is %s in bodhi but tagged as %s in koji" % ( + update.title, update.status, tag)
if __name__ == '__main__':