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
0e5b0a2e
Commit
0e5b0a2e
authored
Jul 17, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Set Jinja2's keep_trailing_newline=True in template_from_string."
This reverts commit
7a8eb0b6
.
parent
03efbfca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
10 deletions
+2
-10
lib/ansible/utils/template.py
+1
-1
test/integration/roles/test_template/tasks/main.yml
+1
-7
test/integration/roles/test_template/vars/main.yml
+0
-2
No files found.
lib/ansible/utils/template.py
View file @
0e5b0a2e
...
...
@@ -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
,
keep_trailing_newline
=
True
,
undefined
=
StrictUndefined
,
extensions
=
_get_extensions
(),
finalize
=
my_finalize
)
environment
=
jinja2
.
Environment
(
trim_blocks
=
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 @
0e5b0a2e
...
...
@@ -63,10 +63,4 @@
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 @
0e5b0a2e
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