mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Check for version in list of installed versions (#34864)
* Find version in list of installed versions * lint error
This commit is contained in:
parent
6394030db3
commit
815ffdfe45
@ -588,7 +588,7 @@ def install(name=None, refresh=False, pkgs=None, saltenv='base', **kwargs):
|
||||
version_num = _get_latest_pkg_version(pkginfo)
|
||||
|
||||
# Check if the version is already installed
|
||||
if version_num == old.get(pkg_name) \
|
||||
if version_num in old.get(pkg_name, '').split(',') \
|
||||
or (pkg_name in old and old[pkg_name] == 'Not Found'):
|
||||
# Desired version number already installed
|
||||
ret[pkg_name] = {'current': version_num}
|
||||
@ -874,7 +874,7 @@ def remove(name=None, pkgs=None, version=None, **kwargs):
|
||||
ret[target] = {'current': 'not installed'}
|
||||
continue
|
||||
else:
|
||||
if not version_num == old.get(target) \
|
||||
if version_num not in old.get(target, '').split(',') \
|
||||
and not old.get(target) == "Not Found" \
|
||||
and version_num != 'latest':
|
||||
log.error('{0} {1} not installed'.format(target, version))
|
||||
|
Loading…
Reference in New Issue
Block a user