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
3f3b2a94
Commit
3f3b2a94
authored
Apr 12, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smush Jinja2 braces in playbooks so unresolved variables get parsed nicely
parent
687a6809
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
.gitignore
+5
-5
Makefile
+0
-14
lib/ansible/utils/template.py
+10
-0
No files found.
.gitignore
View file @
3f3b2a94
...
...
@@ -22,10 +22,10 @@ docs/man/man3/*
*.sublime-project
*.sublime-workspace
# docsite stuff...
docsite/rst/modules
docsite/*.html
docsite/_static/*.gif
docsite/_static/*.png
docsite/_static/websupport.js
docsite/
latest/
rst/modules
docsite/
latest/
*.html
docsite/
latest/
_static/*.gif
docsite/
latest/
_static/*.png
docsite/
latest/
_static/websupport.js
# deb building stuff...
debian/
Makefile
View file @
3f3b2a94
...
...
@@ -177,22 +177,8 @@ deb: debian
modulepages
:
PYTHONPATH
=
./lib
$(PYTHON)
hacking/module_formatter.py
-A
$(VERSION)
-t
man
-o
docs/man/man3/
--module-dir
=
library
--template-dir
=
hacking/templates
modulejson
:
mkdir
-p
docs/json
PYTHONPATH
=
./lib
$(PYTHON)
hacking/module_formatter.py
-A
$(VERSION)
-t
json
-o
docs/json
--module-dir
=
library
--template-dir
=
hacking/templates
modulejs
:
mkdir
-p
docs/js
make modulejson
PYTHONPATH
=
./lib
$(PYTHON)
hacking/module_formatter.py
-A
$(VERSION)
-t
js
-o
docs/js
--module-dir
=
docs/json
--template-dir
=
hacking/templates
# because this requires Sphinx it is not run as part of every build, those building the RPM and so on can ignore this
webdocs
:
(
cd
docsite/latest
;
make docs
)
PYTHONPATH
=
./lib
$(PYTHON)
hacking/module_formatter.py
-A
$(VERSION)
-t
json
-o
docs/json
--module-dir
=
library
--template-dir
=
hacking/templates
modulejs
:
modulejson
-
(
mkdir
-p
docs/json
)
PYTHONPATH
=
./lib
$(PYTHON)
hacking/module_formatter.py
-A
$(VERSION)
-t
js
-o
docs/json
--module-dir
=
library
--template-dir
=
hacking/templates
lib/ansible/utils/template.py
View file @
3f3b2a94
...
...
@@ -432,9 +432,19 @@ def _get_filter_plugins():
return
FILTER_PLUGINS
def
_smush_braces
(
data
):
''' smush Jinaj2 braces so unresolved templates like {{ foo }} don't get parsed weird by key=value code '''
while
data
.
find
(
'{{ '
)
!=
-
1
:
data
=
data
.
replace
(
'{{ '
,
'{{'
)
while
data
.
find
(
' }}'
)
!=
-
1
:
data
=
data
.
replace
(
' }}'
,
'}}'
)
return
data
def
template_from_string
(
basedir
,
data
,
vars
):
''' run a file through the (Jinja2) templating engine '''
data
=
_smush_braces
(
data
)
try
:
if
type
(
data
)
==
str
:
data
=
unicode
(
data
,
'utf-8'
)
...
...
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