From 5f952007f67610444be87d7105075f273a0e22dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ka=C5=BAmierczak?= Date: Fri, 12 May 2017 10:35:25 +0200 Subject: [PATCH] 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. --- salt/modules/zypper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 714afbb62f..a07a371039 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -1068,6 +1068,12 @@ def install(name=None, __context__.pop('pkg.list_pkgs', None) 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) if errors: