forked from jgraichen/salt-tower
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy context dicts when rendering templates
This avoid modifing `tmplpath` and `tmpldir` in-place which would effect following renderings in the parent template. This would break e.g. relative lookups as they would be relative to the override path of the sub-template, not the actual parent template. Unfortunatly, with yamlet not longer overriding tmpldir, using e.g. `render` in jinja templates becomes difficult, as files would be loaded relative to the original sls file, as `render` uses the context from when it was injected (the sls file), and the path in not longer mutated by tha yamlet !include handler. This commit therefore removes the direct relative path handing from `render`. Relative files must be included using `tmpldir`: {{ render(tmpldir + "/file") }} This works as expected because `tmpldir` is taken from the copied context injected by the yamlet renderer.
- Loading branch information
Showing
5 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters