Merge lp:~stub/charm-helpers/shush-apt into lp:charm-helpers

Proposed by Stuart Bishop
Status: Merged
Merged at revision: 608
Proposed branch: lp:~stub/charm-helpers/shush-apt
Merge into: lp:charm-helpers
Diff against target: 33 lines (+3/-3)
2 files modified
charmhelpers/fetch/__init__.py (+2/-2)
tests/fetch/test_fetch.py (+1/-1)
To merge this branch: bzr merge lp:~stub/charm-helpers/shush-apt
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+300055@code.launchpad.net

Description of the change

charmhelpers.fetch.apt_cache() spams logs. Stop it by default.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

+1 much needed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/fetch/__init__.py'
--- charmhelpers/fetch/__init__.py 2016-07-06 14:41:05 +0000
+++ charmhelpers/fetch/__init__.py 2016-07-14 10:24:37 +0000
@@ -178,14 +178,14 @@
178 return _pkgs178 return _pkgs
179179
180180
181def apt_cache(in_memory=True):181def apt_cache(in_memory=True, progress=None):
182 """Build and return an apt cache"""182 """Build and return an apt cache"""
183 from apt import apt_pkg183 from apt import apt_pkg
184 apt_pkg.init()184 apt_pkg.init()
185 if in_memory:185 if in_memory:
186 apt_pkg.config.set("Dir::Cache::pkgcache", "")186 apt_pkg.config.set("Dir::Cache::pkgcache", "")
187 apt_pkg.config.set("Dir::Cache::srcpkgcache", "")187 apt_pkg.config.set("Dir::Cache::srcpkgcache", "")
188 return apt_pkg.Cache()188 return apt_pkg.Cache(progress)
189189
190190
191def apt_install(packages, options=None, fatal=False):191def apt_install(packages, options=None, fatal=False):
192192
=== modified file 'tests/fetch/test_fetch.py'
--- tests/fetch/test_fetch.py 2015-12-09 23:06:09 +0000
+++ tests/fetch/test_fetch.py 2016-07-14 10:24:37 +0000
@@ -31,7 +31,7 @@
31}31}
3232
3333
34def fake_apt_cache():34def fake_apt_cache(in_memory=True, progress=None):
35 def _get(package):35 def _get(package):
36 pkg = MagicMock()36 pkg = MagicMock()
37 if package not in FAKE_APT_CACHE:37 if package not in FAKE_APT_CACHE:

Subscribers

People subscribed via source and target branches