older python-apt compatibility

reviewable/pr18780/r1
fabios 10 years ago
parent 6fce4a9c3d
commit d19f7c7026

@ -202,8 +202,12 @@ def package_status(m, pkgname, version, cache, state):
ll_pkg = cache._cache[pkgname] # the low-level package object
except KeyError:
if state == 'install':
if cache.get_providing_packages(pkgname):
return False, True, False
try:
if cache.get_providing_packages(pkgname):
return False, True, False
except AttributeError:
# older python-apt providing packages cannot be used
pass
m.fail_json(msg="No package matching '%s' is available" % pkgname)
else:
return False, False, False

Loading…
Cancel
Save