~heut2008/charms/trusty/glance/user-config-flags

« back to all changes in this revision

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

  • Committer: Liam Young
  • Date: 2014-08-26 13:26:49 UTC
  • Revision ID: liam.young@canonical.com-20140826132649-sia3wap8ktgiu1yi
Sync charm helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
 
333
333
    '''
334
334
    import apt_pkg
 
335
    from charmhelpers.fetch import apt_cache
335
336
    if not pkgcache:
336
 
        apt_pkg.init()
337
 
        # Force Apt to build its cache in memory. That way we avoid race
338
 
        # conditions with other applications building the cache in the same
339
 
        # place.
340
 
        apt_pkg.config.set("Dir::Cache::pkgcache", "")
341
 
        pkgcache = apt_pkg.Cache()
 
337
        pkgcache = apt_cache()
342
338
    pkg = pkgcache[package]
343
339
    return apt_pkg.version_compare(pkg.current_ver.ver_str, revno)
344
340