Upgrading to 2016.3, running state.apply showed that file.serialize states with formatter: json now produces a harder to read format with no whitespace.
Guessing this is the cause: 53dd9ae13822e181febfad66647cea9024096562 - https://github.com/saltstack/salt/pull/28906
I can think of two possible solutions here:
readable argument to every serializer functionserializer_options argument from the state to the serializer functionThanks @anlutro !
This not only happens with the JSON serializer but also with the YAML serializer (possible others as well):
/etc/salt/minion.d/minion.conf:
file.serialize:
- formatter: yaml
- dataset_pillar: salt:minion
Now produces:
ID: /etc/salt/minion.d/minion.conf
Function: file.serialize
Result: True
Comment: File /etc/salt/minion.d/minion.conf updated
Started: 08:58:29.165454
Duration: 118.816 ms
Changes:
----------
diff:
---
+++
@@ -1,4 +1 @@
-log_level: warn
-master: master
-mine_interval: 10
-minion_id: minion
+{log_level: warn, master: master, mine_interval: 10, minion_id: minion}
Although the changes are still valid JSON or YAML data, this is really bad as:
Any updates? This single issue is preventing me from upgrading.
OK, please give #35688 a whirl. Thanks.
Most helpful comment
This not only happens with the JSON serializer but also with the YAML serializer (possible others as well):
Now produces:
Although the changes are still valid JSON or YAML data, this is really bad as: