Check for version in list of installed versions (#34864)

* Find version in list of installed versions

* lint error
This commit is contained in:
jmacfar 2016-07-22 17:44:42 -05:00 committed by Nicole Thomas
parent 6394030db3
commit 815ffdfe45

View File

@ -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))