Filter all calls to formulas_git_opt through load_yaml #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 Jinjaset
statements do not getdeserialized, 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
).Closes #175.