mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Adjusted based on feed back.
This commit is contained in:
parent
9f18f7cdf5
commit
14659f9cad
@ -2512,32 +2512,26 @@ def latest(
|
||||
'result': None,
|
||||
'comment': '\n'.join(comments)}
|
||||
|
||||
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.keys()]
|
||||
else:
|
||||
# Build updated list of pkgs to exclude non-targeted ones
|
||||
targeted_pkgs = list(targets.keys()) if pkgs else None
|
||||
|
||||
# No need to refresh, if a refresh was necessary it would have been
|
||||
# performed above when pkg.latest_version was run.
|
||||
try:
|
||||
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.keys()]
|
||||
changes = __salt__['pkg.install'](name=None,
|
||||
refresh=False,
|
||||
fromrepo=fromrepo,
|
||||
skip_verify=skip_verify,
|
||||
pkgs=targeted_pkgs,
|
||||
**kwargs)
|
||||
else:
|
||||
# Build updated list of pkgs to exclude non-targeted ones
|
||||
targeted_pkgs = list(targets.keys()) if pkgs else None
|
||||
changes = __salt__['pkg.install'](name,
|
||||
refresh=False,
|
||||
fromrepo=fromrepo,
|
||||
skip_verify=skip_verify,
|
||||
pkgs=targeted_pkgs,
|
||||
**kwargs)
|
||||
changes = __salt__['pkg.install'](name=None,
|
||||
refresh=False,
|
||||
fromrepo=fromrepo,
|
||||
skip_verify=skip_verify,
|
||||
pkgs=targeted_pkgs,
|
||||
**kwargs)
|
||||
except CommandExecutionError as exc:
|
||||
return {'name': name,
|
||||
'changes': {},
|
||||
|
Loading…
Reference in New Issue
Block a user