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
42b52948
Commit
42b52948
authored
Jul 16, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of
https://github.com/leverich/ansible
into leverich-devel
parents
297593b2
7a8eb0b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
lib/ansible/utils/template.py
+1
-1
test/integration/roles/test_template/tasks/main.yml
+7
-1
test/integration/roles/test_template/vars/main.yml
+2
-0
No files found.
lib/ansible/utils/template.py
View file @
42b52948
...
...
@@ -322,7 +322,7 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
def
my_finalize
(
thing
):
return
thing
if
thing
is
not
None
else
''
environment
=
jinja2
.
Environment
(
trim_blocks
=
True
,
undefined
=
StrictUndefined
,
extensions
=
_get_extensions
(),
finalize
=
my_finalize
)
environment
=
jinja2
.
Environment
(
trim_blocks
=
True
,
keep_trailing_newline
=
True
,
undefined
=
StrictUndefined
,
extensions
=
_get_extensions
(),
finalize
=
my_finalize
)
environment
.
filters
.
update
(
_get_filters
())
environment
.
template_class
=
J2Template
...
...
test/integration/roles/test_template/tasks/main.yml
View file @
42b52948
...
...
@@ -63,4 +63,10 @@
assert
:
that
:
-
"
file_result.changed
!=
True"
# VERIFY STRING TEMPLATE PRESERVES NEWLINE
-
name
:
ensure template strings preserve newline
assert
:
that
:
-
"
newline_no_template_string
==
newline_template_string"
test/integration/roles/test_template/vars/main.yml
View file @
42b52948
templated_var
:
templated_var_loaded
newline_template_string
:
"
Hello
{{
'World'
}}
\n
"
newline_no_template_string
:
"
Hello
World
\n
"
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