mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Merge pull request #486 from ucam-cl-dtg/fix_apt
Use correct apt module functions
This commit is contained in:
commit
624c826a27
1 changed files with 3 additions and 3 deletions
|
@ -96,9 +96,9 @@ def config():
|
||||||
|
|
||||||
def check_origin(pkg):
|
def check_origin(pkg):
|
||||||
#print 'Checking: %s (%s)' % (pkg.name, map(str, pkg.candidateOrigin))
|
#print 'Checking: %s (%s)' % (pkg.name, map(str, pkg.candidateOrigin))
|
||||||
if pkg.candidateOrigin:
|
if pkg.candidate.origins:
|
||||||
for archive in archives:
|
for archive in archives:
|
||||||
for origin in pkg.candidateOrigin:
|
for origin in pkg.candidate.origins:
|
||||||
#a = origin.archive.rpartition('-')[2]
|
#a = origin.archive.rpartition('-')[2]
|
||||||
a = origin.archive.split('-')[origin.archive.count('-')]
|
a = origin.archive.split('-')[origin.archive.count('-')]
|
||||||
if a == archive and origin.origin in origins:
|
if a == archive and origin.origin in origins:
|
||||||
|
@ -123,7 +123,7 @@ except ImportError:
|
||||||
pkgs = {}
|
pkgs = {}
|
||||||
total = 0
|
total = 0
|
||||||
for pkg in apt.Cache():
|
for pkg in apt.Cache():
|
||||||
if pkg.isUpgradable:
|
if pkg.is_upgradable:
|
||||||
a = check_origin(pkg)
|
a = check_origin(pkg)
|
||||||
pkgs[a] = pkgs.get(a, 0) + 1
|
pkgs[a] = pkgs.get(a, 0) + 1
|
||||||
total += 1
|
total += 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue