fixes saltstack/salt#66262 pillar.ls doesn't accept kwargs

This commit is contained in:
nicholasmhughes 2024-03-22 21:17:43 -04:00 committed by Pedro Algarvio
parent 176fe04e8d
commit 296f6648f2
3 changed files with 9 additions and 2 deletions

1
changelog/66262.fixed.md Normal file
View file

@ -0,0 +1 @@
Fixed pillar.ls doesn't accept kwargs

View file

@ -328,7 +328,7 @@ def obfuscate(*args, **kwargs):
# naming chosen for consistency with grains.ls, although it breaks the short
# identifier rule.
def ls(*args):
def ls(*args, **kwargs):
"""
.. versionadded:: 2015.8.0
@ -342,7 +342,7 @@ def ls(*args):
salt '*' pillar.ls
"""
return list(items(*args))
return list(items(*args, **kwargs))
def item(*args, **kwargs):

View file

@ -180,3 +180,9 @@ def test_pillar_keys():
test_key = "7:11"
res = pillarmod.keys(test_key)
assert res == ["12"]
def test_ls_pass_kwargs(pillar_value):
with patch("salt.modules.pillar.items", MagicMock(return_value=pillar_value)):
ls = sorted(pillarmod.ls(pillarenv="base"))
assert ls == ["a", "b"]