mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #47702 from damon-atkins/2017.7.6_fix_pkg.latest_state
State pkg.latest called win pkg.install with list of pkgs and the required versions
This commit is contained in:
commit
8a5b34f7d9
1 changed files with 13 additions and 5 deletions
|
@ -2449,13 +2449,21 @@ def latest(
|
|||
'result': None,
|
||||
'comment': '\n'.join(comments)}
|
||||
|
||||
# Build updated list of pkgs to exclude non-targeted ones
|
||||
targeted_pkgs = list(targets.keys()) if pkgs else None
|
||||
if salt.utils.is_windows():
|
||||
# pkg.install execution module on windows ensures the software
|
||||
# package is installed when no version is specified, it does not
|
||||
# upgrade the software to the latest. This is per the design.
|
||||
# Build updated list of pkgs *with verion number*, exclude
|
||||
# non-targeted ones
|
||||
targeted_pkgs = [{x: targets[x]} for x in targets]
|
||||
else:
|
||||
# Build updated list of pkgs to exclude non-targeted ones
|
||||
targeted_pkgs = list(targets)
|
||||
|
||||
# No need to refresh, if a refresh was necessary it would have been
|
||||
# performed above when pkg.latest_version was run.
|
||||
try:
|
||||
# No need to refresh, if a refresh was necessary it would have been
|
||||
# performed above when pkg.latest_version was run.
|
||||
changes = __salt__['pkg.install'](name,
|
||||
changes = __salt__['pkg.install'](name=None,
|
||||
refresh=False,
|
||||
fromrepo=fromrepo,
|
||||
skip_verify=skip_verify,
|
||||
|
|
Loading…
Add table
Reference in a new issue