From 84951f7cd660b7b00eeb348fb9eb2663f6b178e4 Mon Sep 17 00:00:00 2001 From: Alexander Graul Date: Wed, 4 May 2022 15:18:45 +0200 Subject: [PATCH] Don't turn attr="all" into a list pkg_resource.format_pkg_list expects its `attr` argument to be either a list of attributes or the string "all" to indicate all available attributes should be used for formatting. Fixes: https://github.com/saltstack/salt/issues/62032 --- changelog/62032.fixed | 1 + salt/modules/yumpkg.py | 2 +- salt/modules/zypperpkg.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog/62032.fixed diff --git a/changelog/62032.fixed b/changelog/62032.fixed new file mode 100644 index 00000000000..ceb3cc89b95 --- /dev/null +++ b/changelog/62032.fixed @@ -0,0 +1 @@ +Fix attr=all handling in pkg.list_pkgs() (yum/zypper). diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 3f855d255fb..c613d658660 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -735,7 +735,7 @@ def list_pkgs(versions_as_list=False, **kwargs): return {} attr = kwargs.get("attr") - if attr is not None: + if attr is not None and attr != "all": attr = salt.utils.args.split_input(attr) contextkey = "pkg.list_pkgs" diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py index c5215100856..77f1e323676 100644 --- a/salt/modules/zypperpkg.py +++ b/salt/modules/zypperpkg.py @@ -914,7 +914,7 @@ def list_pkgs(versions_as_list=False, root=None, includes=None, **kwargs): return {} attr = kwargs.get("attr") - if attr is not None: + if attr is not None and attr != "all": attr = salt.utils.args.split_input(attr) includes = includes if includes else []