Fixed issue #18880 in 2014.7 branch

This commit is contained in:
chris-prince 2015-05-02 11:24:06 -07:00
parent 16ecefd466
commit 0fa25dbb58

View file

@ -145,25 +145,25 @@ def installed(name,
pkgs_to_install.append(pkg)
continue
if pkg_name not in installed_pkgs:
if (pkg_name not in installed_pkgs or
'version' not in installed_pkgs[pkg_name]):
pkgs_to_install.append(pkg)
continue
if pkg_name in installed_pkgs:
installed_name_ver = '{0}@{1}'.format(pkg_name,
installed_pkgs[pkg_name]['version'])
installed_name_ver = '{0}@{1}'.format(pkg_name,
installed_pkgs[pkg_name]['version'])
# If given an explicit version check the installed version matches.
if pkg_ver:
if installed_pkgs[pkg_name].get('version') != pkg_ver:
pkgs_to_install.append(pkg)
else:
pkgs_satisfied.append(installed_name_ver)
continue
# If given an explicit version check the installed version matches.
if pkg_ver:
if installed_pkgs[pkg_name].get('version') != pkg_ver:
pkgs_to_install.append(pkg)
else:
pkgs_satisfied.append(installed_name_ver)
continue
continue
else:
pkgs_satisfied.append(installed_name_ver)
continue
if __opts__['test']:
ret['result'] = None