mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
older python-apt compatibility
This commit is contained in:
parent
301c8b8e09
commit
21bfa80203
1 changed files with 6 additions and 2 deletions
|
@ -202,8 +202,12 @@ def package_status(m, pkgname, version, cache, state):
|
||||||
ll_pkg = cache._cache[pkgname] # the low-level package object
|
ll_pkg = cache._cache[pkgname] # the low-level package object
|
||||||
except KeyError:
|
except KeyError:
|
||||||
if state == 'install':
|
if state == 'install':
|
||||||
if cache.get_providing_packages(pkgname):
|
try:
|
||||||
return False, True, False
|
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)
|
m.fail_json(msg="No package matching '%s' is available" % pkgname)
|
||||||
else:
|
else:
|
||||||
return False, False, False
|
return False, False, False
|
||||||
|
|
Loading…
Reference in a new issue