Fix: zypper handling of multiple version packages

For kernel packages, zypper reports multiple versions as "new" during
upgrade. Thus, a salt state requesting pkg.latest of any kernel package
would fail, even though zypper runs successfully. This commit provides
a simple fix.
This commit is contained in:
Piotr Kaźmierczak 2017-05-12 10:35:25 +02:00
parent b136b15330
commit 5f952007f6

View File

@ -1068,6 +1068,12 @@ def install(name=None,
__context__.pop('pkg.list_pkgs', None) __context__.pop('pkg.list_pkgs', None)
new = list_pkgs() new = list_pkgs()
# Handle packages which report multiple new versions
# (affects only kernel packages at this point)
for pkg in new:
new[pkg] = new[pkg].split(',')[-1]
ret = salt.utils.compare_dicts(old, new) ret = salt.utils.compare_dicts(old, new)
if errors: if errors: