mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix incorrect override of minion node definition
A pillars dict in a minion node definition was not overridding correctly the same dict in classes. * salt/utils/saltclass.py (expanded_dict_from_minion): do not pass a reference to minion dict or it will be overridden by classes during expansion. Fixes: #63933
This commit is contained in:
parent
9ef879aee4
commit
d1ca30c2ad
2 changed files with 8 additions and 1 deletions
4
changelog/63933.fixed.md
Normal file
4
changelog/63933.fixed.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
Issue 63933: Fixes an issue with `saltclass.expanded_dict_from_minion`
|
||||||
|
function where it was passing a reference to minion `dict` which was
|
||||||
|
overridden by nested classes during class expansion. Copy the node
|
||||||
|
definition with `copy.deepcopy` instead of passing a reference.
|
|
@ -1,3 +1,4 @@
|
||||||
|
import copy
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -362,7 +363,9 @@ def expanded_dict_from_minion(minion_id, salt_data):
|
||||||
node_dict[minion_id] = {}
|
node_dict[minion_id] = {}
|
||||||
|
|
||||||
# Merge newly found pillars into existing ones
|
# Merge newly found pillars into existing ones
|
||||||
dict_merge(salt_data["__pillar__"], node_dict[minion_id].get("pillars", {}))
|
dict_merge(
|
||||||
|
salt_data["__pillar__"], copy.deepcopy(node_dict[minion_id]).get("pillars", {})
|
||||||
|
)
|
||||||
|
|
||||||
# Get 2 ordered lists:
|
# Get 2 ordered lists:
|
||||||
# expanded_classes: A list of all the dicts
|
# expanded_classes: A list of all the dicts
|
||||||
|
|
Loading…
Add table
Reference in a new issue