mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed issue #18880 in 2014.7 branch
This commit is contained in:
parent
16ecefd466
commit
0fa25dbb58
1 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue