mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
fix compatibility issues with python-apt < 0.7.9
This commit is contained in:
@@ -206,7 +206,12 @@ def package_status(m, pkgname, version, cache, state):
|
|||||||
package_is_installed = pkg.isInstalled
|
package_is_installed = pkg.isInstalled
|
||||||
|
|
||||||
if version:
|
if version:
|
||||||
avail_upgrades = fnmatch.filter((p.version for p in pkg.versions), version)
|
try:
|
||||||
|
avail_upgrades = fnmatch.filter((p.version for p in pkg.versions), version)
|
||||||
|
except AttributeError:
|
||||||
|
# assume older version of python-apt is installed
|
||||||
|
# apt.package.Package#versions require python-apt >= 0.7.9.
|
||||||
|
avail_upgrades = []
|
||||||
|
|
||||||
if package_is_installed:
|
if package_is_installed:
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user