~openstack-charmers/charms/trusty/quantum-gateway/old-1410

« back to all changes in this revision

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

  • Committer: james.page at ubuntu
  • Date: 2014-07-28 11:33:12 UTC
  • Revision ID: james.page@ubuntu.com-20140728113312-nzew0x1rn4ogh1g9
Resync helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
322
322
    import apt_pkg
323
323
    if not pkgcache:
324
324
        apt_pkg.init()
 
325
        # Force Apt to build its cache in memory. That way we avoid race
 
326
        # conditions with other applications building the cache in the same
 
327
        # place.
 
328
        apt_pkg.config.set("Dir::Cache::pkgcache", "")
325
329
        pkgcache = apt_pkg.Cache()
326
330
    pkg = pkgcache[package]
327
331
    return apt_pkg.version_compare(pkg.current_ver.ver_str, revno)