mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Merge pull request #5645 from resmo/fix/apt_pkg_version
apt: fixed pkg=<name>=<version> fails if package is not yet installed. Tested and it fixes the problem on more recent versions of apt.
This commit is contained in:
@@ -191,7 +191,7 @@ def package_status(m, pkgname, version, cache, state):
|
|||||||
# assume older version of python-apt is installed
|
# assume older version of python-apt is installed
|
||||||
package_is_installed = pkg.isInstalled
|
package_is_installed = pkg.isInstalled
|
||||||
|
|
||||||
if version:
|
if version and package_is_installed:
|
||||||
try:
|
try:
|
||||||
installed_version = pkg.installed.version
|
installed_version = pkg.installed.version
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user