Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
4a6b5c5d
Commit
4a6b5c5d
authored
Oct 08, 2012
by
Stijn Opheide
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relative paths for (include/extends) in jinja2 templates
parent
c8854a23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
.gitignore
+3
-0
lib/ansible/utils.py
+2
-1
No files found.
.gitignore
View file @
4a6b5c5d
...
@@ -14,3 +14,6 @@ rpm-build
...
@@ -14,3 +14,6 @@ rpm-build
.idea
.idea
# Mac OS X stuff
# Mac OS X stuff
.DS_Store
.DS_Store
# Sublime stuff
*.sublime-project
*.sublime-workspace
lib/ansible/utils.py
View file @
4a6b5c5d
...
@@ -392,7 +392,8 @@ def template_from_file(basedir, path, vars):
...
@@ -392,7 +392,8 @@ def template_from_file(basedir, path, vars):
''' run a file through the templating engine '''
''' run a file through the templating engine '''
realpath
=
path_dwim
(
basedir
,
path
)
realpath
=
path_dwim
(
basedir
,
path
)
environment
=
jinja2
.
Environment
(
loader
=
jinja2
.
FileSystemLoader
(
basedir
),
trim_blocks
=
True
)
loader
=
jinja2
.
FileSystemLoader
([
basedir
,
os
.
path
.
dirname
(
realpath
)])
environment
=
jinja2
.
Environment
(
loader
=
loader
,
trim_blocks
=
True
)
environment
.
filters
[
'to_json'
]
=
json
.
dumps
environment
.
filters
[
'to_json'
]
=
json
.
dumps
environment
.
filters
[
'from_json'
]
=
json
.
loads
environment
.
filters
[
'from_json'
]
=
json
.
loads
environment
.
filters
[
'to_yaml'
]
=
yaml
.
dump
environment
.
filters
[
'to_yaml'
]
=
yaml
.
dump
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment