salt/skip-package-names-without-colon-bsc-1208691-578.patch

28 lines
1.0 KiB
Diff
Raw Normal View History

From c61da0bef8d4d8394592db2f9995cdf4820c02af Mon Sep 17 00:00:00 2001
From: Alexander Graul <agraul@suse.com>
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 44f2cdbd3a..cdec397d69 100644
--- a/salt/modules/zypperpkg.py
+++ b/salt/modules/zypperpkg.py
@@ -2688,6 +2688,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