Skip to content

Commit

Permalink
Don't turn attr="all" into a list
Browse files Browse the repository at this point in the history
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: saltstack#62032
  • Loading branch information
agraul committed Oct 6, 2022
1 parent ff16eae commit 3b97041
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/62032.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix attr=all handling in pkg.list_pkgs() (yum/zypper).
2 changes: 1 addition & 1 deletion salt/modules/yumpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion salt/modules/zypperpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down

0 comments on commit 3b97041

Please sign in to comment.