mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
83ae6a1432
commit
c950527b24
1 changed files with 4 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue