1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #469 from nafeger/devel

Add support for older version of python-apt
This commit is contained in:
Michael DeHaan 2012-06-13 19:21:31 -07:00
commit 7926ab5b95

View file

@ -74,9 +74,17 @@ def package_status(pkgname, version, cache):
except KeyError:
fail_json(msg="No package matching '%s' is available" % pkgname)
if version:
return pkg.is_installed and pkg.installed.version == version, False
try :
return pkg.is_installed and pkg.installed.version == version, False
except AttributeError:
#assume older version of python-apt is installed
return pkg.isInstalled and pkg.installedVersion == version, False
else:
return pkg.is_installed, pkg.is_upgradable
try :
return pkg.is_installed, pkg.is_upgradable
except AttributeError:
#assume older version of python-apt is installed
return pkg.isInstalled, pkg.isUpgradable
def install(pkgspec, cache, upgrade=False, default_release=None):
name, version = package_split(pkgspec)