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
This commit is contained in:
Alexander Graul 2022-05-04 15:18:45 +02:00 committed by Megan Wilhite
parent bb1fe9cf22
commit 84951f7cd6
3 changed files with 3 additions and 2 deletions

1
changelog/62032.fixed Normal file
View file

@ -0,0 +1 @@
Fix attr=all handling in pkg.list_pkgs() (yum/zypper).

View file

@ -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"

View file

@ -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 []