-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix #33437: Prevent None values from overwriting existing pillar data #68533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3006.x
Are you sure you want to change the base?
Conversation
254c753 to
f298ff7
Compare
…llar data When merging pillar data, if one pillar file is empty (e.g., due to conditional rendering that produces no output), None values were overwriting existing non-empty dictionaries. This fix adds a _filter_none_overwrites function that recursively removes None values that would overwrite existing non-empty dicts during the pillar merge process. - Added _filter_none_overwrites function to salt/pillar/__init__.py - Applied filter before merging pillar state - Added test case to test_pillar.py to verify the fix
f298ff7 to
6e99078
Compare
twangboy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still using OrderedDict on 3006.x? Maybe it's only removed on master.
Also needs a changelog
| # causes an UnboundLocalError. This should be investigated and fixed, but until | ||
| # then, leave the import directly below this comment intact. | ||
| from salt.utils.dictupdate import merge | ||
| from salt.utils.odict import OrderedDict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using this anymore, right?
| import salt.loader | ||
| import salt.pillar | ||
| import salt.utils.cache | ||
| from salt.utils.odict import OrderedDict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
When merging pillar data, None values were overwriting existing non-empty dictionaries. This fix adds a _filter_none_overwrites function that filters out None values during pillar merging to preserve existing data.
Fixes #33437