~lazypower/charms/trusty/keystone/fix_proof

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/host.py

  • Committer: Liam Young
  • Date: 2014-08-29 06:36:15 UTC
  • mfrom: (67.1.1 keystone)
  • Revision ID: liam.young@canonical.com-20140829063615-tb2vbtah4r3s0k9z
[gnuoy,r=tribaal] Resync charmhelpers for apt cache bug fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
       0 => Installed revno is the same as supplied arg
319
319
      -1 => Installed revno is less than supplied arg
320
320
    '''
 
321
    from charmhelpers.fetch import apt_cache
321
322
    if not pkgcache:
322
 
        apt_pkg.init()
323
 
        # Force Apt to build its cache in memory. That way we avoid race
324
 
        # conditions with other applications building the cache in the same
325
 
        # place.
326
 
        apt_pkg.config.set("Dir::Cache::pkgcache", "")
327
 
        pkgcache = apt_pkg.Cache()
 
323
        pkgcache = apt_cache()
328
324
    pkg = pkgcache[package]
329
325
    return apt_pkg.version_compare(pkg.current_ver.ver_str, revno)