summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_scheduler.py
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-02-28 14:36:34 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-28 14:36:34 +0100
commit6372f5f830827d2ee608e87e85f7d61abe835b93 (patch)
tree0d33faef53123d3e14ff458fda6a696115a7436c /bin/reproducible_scheduler.py
parentfc84314001a8de28e2500cfafd9aad728221f9a8 (diff)
downloadjenkins.debian.net-6372f5f830827d2ee608e87e85f7d61abe835b93.tar.xz
reproducible: run 'apt-get update' for each suites schroot, not on the host
Diffstat (limited to 'bin/reproducible_scheduler.py')
-rwxr-xr-xbin/reproducible_scheduler.py12
1 files changed, 7 insertions, 5 deletions
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)