~tribaal/charms/trusty/ceph-radosgw/trunk

« back to all changes in this revision

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

  • Committer: Christopher Glass
  • Date: 2014-09-24 12:36:50 UTC
  • mfrom: (22.1.1 resync-stable-charm-helpers)
  • Revision ID: christopher.glass@canonical.com-20140924123650-ycalmj7aehppfn3x
[tribaal, r=gnuoy] Sync to latest charm-helpers.

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)