From 6d122245f15a206dbfa92703b954d535c5c34dd4 Mon Sep 17 00:00:00 2001 From: Alexander Graul Date: Mon, 27 Feb 2023 11:35:41 +0100 Subject: [PATCH] Skip package names without colon (bsc#1208691) (#578) Fixes a problem in `_find_ptf_packages()` when passing multiple packages to `zypperpkg.remove` / `zypperpkg.purge`. The problem occurs when a passed package is not installed, in that case the output of the `rpm` subprocess is not parsed correctly. --- salt/modules/zypperpkg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py index cd057ec637..64373e59fb 100644 --- a/salt/modules/zypperpkg.py +++ b/salt/modules/zypperpkg.py @@ -2758,6 +2758,8 @@ def _find_ptf_packages(pkgs, root=None): for line in output.splitlines(): if not line.strip(): continue + if ":" not in line: + continue pkg, provides = line.split(":", 1) if "ptf()" in provides: ptfs.append(pkg) -- 2.39.2