[BUG] file.serialize
does not merge lists even if merge_if_exists: True
is set
#66903
Open
2 of 9 tasks
Labels
Description
I am using
file.serialize
to update the contents of a JSON file. Since that file may already exist, I have setmerge_if_exists: True
in order to merge the file contents with thedataset
given in the state. Now if both the file anddataset
have a list, Salt does not merge the lists but instead overwrites it with version fromdataset
.Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)
Please be as specific as possible and give set-up details.
Steps to Reproduce the behavior
(Include debug logs if possible and relevant)
Create following 3 files:
Then apply the state or run test-mode:
Expected behavior
The lists from the file and from
dataset
should be merged, like this:Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
The issue seems to be a missing third parameter
merge_lists=True
in this function call:in
salt/salt/states/file.py
Line 8470 in 246d066
The text was updated successfully, but these errors were encountered: