From b90db64a0a5811639075e3ff87da449d5377a126 Mon Sep 17 00:00:00 2001 From: Oliver Chick Date: Tue, 29 Oct 2013 17:47:44 +0000 Subject: [PATCH 1/2] Fix typo that prevents munin from learning about upgradable packages --- plugins/ubuntu/apt_ubuntu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ubuntu/apt_ubuntu b/plugins/ubuntu/apt_ubuntu index 65907739..0dd66d6b 100755 --- a/plugins/ubuntu/apt_ubuntu +++ b/plugins/ubuntu/apt_ubuntu @@ -123,7 +123,7 @@ except ImportError: pkgs = {} total = 0 for pkg in apt.Cache(): - if pkg.isUpgradable: + if pkg.is_upgradable: a = check_origin(pkg) pkgs[a] = pkgs.get(a, 0) + 1 total += 1 From bcae83c51080f2ec19369934d53b02048fb640b7 Mon Sep 17 00:00:00 2001 From: Oliver Chick Date: Fri, 23 May 2014 17:34:17 +0100 Subject: [PATCH 2/2] candidateOrigin has been removed. Replace with candidate.origins --- plugins/ubuntu/apt_ubuntu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ubuntu/apt_ubuntu b/plugins/ubuntu/apt_ubuntu index 0dd66d6b..ae3f414a 100755 --- a/plugins/ubuntu/apt_ubuntu +++ b/plugins/ubuntu/apt_ubuntu @@ -96,9 +96,9 @@ def config(): def check_origin(pkg): #print 'Checking: %s (%s)' % (pkg.name, map(str, pkg.candidateOrigin)) - if pkg.candidateOrigin: + if pkg.candidate.origins: for archive in archives: - for origin in pkg.candidateOrigin: + for origin in pkg.candidate.origins: #a = origin.archive.rpartition('-')[2] a = origin.archive.split('-')[origin.archive.count('-')] if a == archive and origin.origin in origins: