From 6372f5f830827d2ee608e87e85f7d61abe835b93 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 28 Feb 2015 14:36:34 +0100 Subject: reproducible: run 'apt-get update' for each suites schroot, not on the host --- bin/reproducible_scheduler.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_scheduler.py b/bin/reproducible_scheduler.py index 387564a9..38e0c376 100755 --- a/bin/reproducible_scheduler.py +++ b/bin/reproducible_scheduler.py @@ -23,15 +23,17 @@ from reproducible_common import * from reproducible_html_indexes import build_page -def call_apt_update(): +def call_apt_update(suite): # try three times, before failing the job for i in [1, 2, 3]: - if not call(['sudo', 'apt-get', 'update']): + if not call(['schroot', '--directory', '/root', '-u', 'root', \ + '-c', 'source:jenkins-'+suite, '--', \ + 'apt-get', 'update']): return else: - log.warning('apt failed. retring another ' + 3-i + ' times') + log.warning('`apt-get update` failed. Retrying another ' + 3-i + ' times.') sleep(randint(1, 70) + 30) - print_critical_message('`apt-get update` failed for three times in a row') + print_critical_message('`apt-get update` for suite '+suite+' failed three times in a row, giving up.') sys.exit(1) @@ -259,7 +261,7 @@ def scheduler(suite): if __name__ == '__main__': - call_apt_update() for suite in SUITES: + call_apt_update(suite) update_sources_tables(suite) scheduler(suite) -- cgit v1.2.3-70-g09d2