Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/55146.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Flatten yaml node lists to `L@` or `E@` before trying to do the ext_pillar parsing.
For nested Nodegroups this is already done, but on the first level nodegroup a list will fail parsing as compound match.
3 changes: 2 additions & 1 deletion salt/pillar/nodegroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# Import futures

from salt.utils.minions import CkMinions
from salt.utils.minions import CkMinions, nodegroup_comp

__version__ = "0.0.2"

Expand All @@ -56,6 +56,7 @@ def ext_pillar(minion_id, pillar, pillar_name=None):
ckminions = None
for nodegroup_name in all_nodegroups.keys():
ckminions = ckminions or CkMinions(__opts__)
all_nodegroups[nodegroup_name] = nodegroup_comp(nodegroup_name, all_nodegroups)
_res = ckminions.check_minions(all_nodegroups[nodegroup_name], "compound")
match = _res["minions"]

Expand Down
3 changes: 2 additions & 1 deletion tests/pytests/unit/pillar/test_nodegroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def fake_nodegroups(fake_minion_id):
return {
"groupA": fake_minion_id,
"groupB": "another_minion_id",
"groupC": [fake_minion_id, "another_minion_id"]
}


Expand Down Expand Up @@ -48,5 +49,5 @@ def _side_effect(group_sel, t):


def test_succeeds(fake_pillar_name, fake_minion_id):
ret = {fake_pillar_name: ["groupA"]}
ret = {fake_pillar_name: ["groupA", "groupC"]}
_runner(ret, fake_minion_id, fake_pillar_name)
Loading