Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #569 apt module problems on old versions of apt-python #572

Merged
merged 2 commits into from
Jul 11, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/apt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import subprocess
import syslog
import traceback

# added to stave off future warnings about apt api
import warnings;
warnings.filterwarnings('ignore', "apt API not stable yet", FutureWarning)

APT_PATH = "/usr/bin/apt-get"
APT = "DEBIAN_PRIORITY=critical %s" % APT_PATH

Expand Down Expand Up @@ -163,11 +167,11 @@ cache = apt.Cache()
if default_release:
apt_pkg.config['APT::Default-Release'] = default_release
# reopen cache w/ modified config
cache.open()
cache.open(progress=None)

if update_cache == 'yes':
cache.update()
cache.open()
cache.open(progress=None)
if package == None:
exit_json(changed=False)

Expand Down