Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter all calls to formulas_git_opt through load_yaml
Jinja macros are not actually functions. The only thing they can return is a string. In order to return structured data, the callee must serialize it, and the caller must deserialize it. This state formula uses YAML as the intermediary, hence the occurrence of both the `|yaml` (callee) and `|load_yaml` (caller) filters in its code. The post-render "mapping values are not allowed here" error in *salt/formulas.sls* or the broken rendering of *salt/files/master.d/f_defaults.conf* happens because invocations of the `formulas_git_opt` macro in several Jinja `set` statements do not get deserialized, resulting in the trailing newline followed by three dot characters (`...`), which YAML uses to signal the end of a document. Correcting these rendering errors requires adding the necessary deserialization code at those locations (i.e., filtering the macro call through `|load_yaml`).
- Loading branch information