Merge lp:~psivaa/auto-package-testing/cache-update-for-sru into lp:~canonical-ci-engineering/auto-package-testing/enabling-sru-testing

Proposed by Para Siva
Status: Merged
Merged at revision: 389
Proposed branch: lp:~psivaa/auto-package-testing/cache-update-for-sru
Merge into: lp:~canonical-ci-engineering/auto-package-testing/enabling-sru-testing
Diff against target: 26 lines (+3/-2)
1 file modified
jenkins/aptcache.py (+3/-2)
To merge this branch: bzr merge lp:~psivaa/auto-package-testing/cache-update-for-sru
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Vincent Ladeuil (community) Approve
Review via email: mp+250314@code.launchpad.net

Commit message

Porting the cache update fix that we did in boottesting

Description of the change

Porting the cache update fix that we did in boottesting. This will be needed if boottesting branch does not land before this. (The fix was to commit the local changes in d-jenkins so that the cache gets properly updated every 10 mins)

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Good catch !

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

This matches the hotfix that is in place on d-jenkins.ubuntu-ci:/var/lib/jenkins/QA/auto-package-testing/jenkins/aptcache.py

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'jenkins/aptcache.py'
--- jenkins/aptcache.py 2014-04-17 09:56:58 +0000
+++ jenkins/aptcache.py 2015-02-19 14:37:58 +0000
@@ -54,12 +54,12 @@
54 self.proposed = False54 self.proposed = False
5555
56 self.timestampfile = os.path.normpath(56 self.timestampfile = os.path.normpath(
57 os.path.join(rootdir, 'var/cache/apt/pkgcache.bin'))57 os.path.join(rootdir, 'var/cache/apt/cache.timestamp'))
5858
59 super(AptCache, self).__init__(rootdir=rootdir, memonly=False)59 super(AptCache, self).__init__(rootdir=rootdir, memonly=False)
60 self.rootdir = rootdir60 self.rootdir = rootdir
6161
62 def update(self, cache_age=60, force_update=False):62 def update(self, cache_age=10, force_update=False):
63 ''' Equivalent of apt-get update63 ''' Equivalent of apt-get update
6464
65 :param cache_age: Update the cache when it is older than65 :param cache_age: Update the cache when it is older than
@@ -78,6 +78,7 @@
78 not os.path.exists(self.timestampfile)) or (78 not os.path.exists(self.timestampfile)) or (
79 (currtime - timestamp) > cache_age * 60):79 (currtime - timestamp) > cache_age * 60):
80 logging.debug('Updating cache')80 logging.debug('Updating cache')
81 open(self.timestampfile, 'w').close()
81 super(AptCache, self).update()82 super(AptCache, self).update()
82 super(AptCache, self).open()83 super(AptCache, self).open()
83 else:84 else:

Subscribers

People subscribed via source and target branches