~canonical-ci-engineering/auto-package-testing/enabling-sru-testing

« back to all changes in this revision

Viewing changes to jenkins/aptcache.py

  • Committer: Parameswaran Sivatharman
  • Date: 2015-02-19 14:45:12 UTC
  • mfrom: (388.1.1 enabling-sru-testing)
  • Revision ID: para.siva@canonical.com-20150219144512-x722627oqt2ugc0e
Fixing the apt-cache update bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
        self.proposed = False
55
55
 
56
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'))
58
58
 
59
59
        super(AptCache, self).__init__(rootdir=rootdir, memonly=False)
60
60
        self.rootdir = rootdir
61
61
 
62
 
    def update(self, cache_age=60, force_update=False):
 
62
    def update(self, cache_age=10, force_update=False):
63
63
        ''' Equivalent of apt-get update
64
64
 
65
65
        :param cache_age: Update the cache when it is older than
78
78
            not os.path.exists(self.timestampfile)) or (
79
79
                (currtime - timestamp) > cache_age * 60):
80
80
            logging.debug('Updating cache')
 
81
            open(self.timestampfile, 'w').close()
81
82
            super(AptCache, self).update()
82
83
            super(AptCache, self).open()
83
84
        else: