Repository navigation
Conversation
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
|
@oeko2002 This needs to go into 3006.x. I've took the liberty of changing the base branch but there are conflicts that need to be resolved. |
3bc38c4 to
ed808f3
Compare
|
Ok, rebased to 3006.x branch :D |
ed808f3 to
f124bf8
Compare
|
Adjusted the tests |
|
Anything I need to do? |
| ckminions = None | ||
| for nodegroup_name in all_nodegroups.keys(): | ||
| ckminions = ckminions or CkMinions(__opts__) | ||
| all_nodegroups[nodegroup_name] = nodegroup_comp(nodegroup_name, all_nodegroups) |
There was a problem hiding this comment.
While using nodegroup_comp is the correct approach to flatten the list, modifying all_nodegroups[nodegroup_name] in-place mutates the global opts["nodegroups"] structure during the master's runtime. This can cause unexpected side effects for other parallel operations or subsequent lookups that expect the raw definition.
Suggested Change:
Assign the expanded group string to a local variable instead:
group_expr = nodegroup_comp(nodegroup_name, all_nodegroups)
_res = ckminions.check_minions(group_expr, "compound")| if not isinstance(group_sel, list): | ||
| group_sel = [group_sel] | ||
| if any(x for x in group_sel if x.find(fake_minion_id) != -1): | ||
| return {"minions": [fake_minion_id], "missing": []} |
There was a problem hiding this comment.
In production, nodegroup_comp returns a compressed compound match string (e.g., L@minion1,minion2). Because of this, group_sel will never actually be a list at runtime. Forcing it into a list here (group_sel = [group_sel]) causes the test to pass green, but it masks the real string-matching behavior of the code.
Suggested Change:
Update the mock side-effect to directly evaluate the string returned by nodegroup_comp:
def _side_effect(group_sel, t):
# group_sel is a compound string here, not a list
if fake_minion_id in group_sel:
return {"minions": [fake_minion_id], "missing": []}
return {"minions": ["another_minion_id"], "missing": []}|
We are no longer accepting Bugfix releases on the 3006.x branch. Please rebase this on the 3008.x branch. |
What does this PR do?
Supporting of YAML lists for the nodegroups ext_pillar
What issues does this PR fix or reference?
#55146
Previous Behavior
Nodegroups formed as YAML list
fail to parse as ext_pillar nodegroups, resulting in ERROR logs:
New Behavior
Parsing works:
Merge requirements satisfied?
Commits signed with GPG?
No