From 28fffbf83443e8d46cae1c33daa468cf2e6fc04a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 11 Mar 2015 19:35:35 +0100 Subject: reproducible: merge schedule messages into one --- bin/reproducible_scheduler.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py index afb7809d..d82f596f 100755 --- a/bin/reproducible_scheduler.py +++ b/bin/reproducible_scheduler.py @@ -260,6 +260,7 @@ def scheduler(): log.info('Received ' + str(len(old[suite])) + ' old packages in ' + suite + ' to schedule.') log.info('==============================================================') + now_queued_here = {} for suite in SUITES: all_scheduled_pkgs = [] all_scheduled_pkgs.extend(untested[suite]) @@ -268,24 +269,25 @@ def scheduler(): query = 'SELECT count(*) ' + \ 'FROM schedule AS p JOIN sources AS s ON p.package_id=s.id ' + \ 'WHERE s.suite="{suite}"'.format(suite=suite) - now_queued_here = int(query_db(query)[0][0]) + len(all_scheduled_pkgs) - # build the final message text - message = 'Scheduled in ' + suite + ': ' + \ - str(len(untested[suite])) + ' untested packages, ' + \ - str(len(new[suite])) + ' packages with new versions and ' + \ - str(len(old[suite])) + ' with the same version ' + \ - '(total: ' + str(total) + ' of which ' + \ - str(now_queued_here) + ' are in ' + suite + ')' - kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf', - '--relay-msg'] - kgb.extend(message.split()) + now_queued_here[suite] = int(query_db(query)[0][0]) + len(all_scheduled_pkgs) # finally schedule_packages(all_scheduled_pkgs) - call(kgb) - log.info(message) log.info('### Suite ' + suite + ' done ###') log.info('==============================================================') + # update the scheduled page build_page('scheduled') # from reproducible_html_indexes, build global page + # build the kgb message text + message = 'Scheduled in ' + '+'.join(SUITES) + ': ' + \ + '+'.join([str(untested[x]) for x in SUITES]) + ' new and untested packages, ' + \ + '+'.join([str(len(new[x])) for x in SUITES]) + ' packages with new versions and ' + \ + '+'.join([str(len(old[x])) for x in SUITES]) + ' old packages with the same version. ' + \ + 'Total: ' + str(total) + ' split into ' + \ + '+'.join([str(now_queued_here[x]) for x in SUITES]) + log.info(message) + kgb = ['kgb-client', '--conf', '/srv/jenkins/kgb/debian-reproducible.conf', + '--relay-msg'] + kgb.extend(message.split()) + call(kgb) log.info('\n\n\n') log.info(message) -- cgit v1.2.3-70-g09d2