When latest is passed in the state as the version to install, once the package is installed the state runs will fail. pkg.latest_version returned an empty string once the package is installed so we need to grab the installed version in that case to avoid passing an empty string to the pkg module in question.

This commit is contained in:
Gareth J. Greenaway 2015-10-03 10:07:54 -07:00
parent 83ae6a1432
commit c950527b24

View file

@ -933,6 +933,10 @@ def installed(
if version is not None and version == 'latest':
version = __salt__['pkg.latest_version'](name)
# If version is empty, it means the latest version is installed
# so we grab that version to avoid passing an empty string
if not version:
version = __salt__['pkg.version'](name)
kwargs['allow_updates'] = allow_updates
result = _find_install_targets(name, version, pkgs, sources,