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
8752ae69
Commit
8752ae69
authored
Dec 02, 2013
by
Janez Nemanic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for issue #4730 - stacktrace when deferenencing a non-existent group
parent
04b03175
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lib/ansible/utils/template.py
+5
-4
No files found.
lib/ansible/utils/template.py
View file @
8752ae69
...
@@ -532,13 +532,14 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
...
@@ -532,13 +532,14 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
return
lookup
(
*
args
,
basedir
=
basedir
,
**
kwargs
)
return
lookup
(
*
args
,
basedir
=
basedir
,
**
kwargs
)
t
.
globals
[
'lookup'
]
=
my_lookup
t
.
globals
[
'lookup'
]
=
my_lookup
jvars
=
_jinja2_vars
(
basedir
,
vars
,
t
.
globals
,
fail_on_undefined
)
jvars
=
_jinja2_vars
(
basedir
,
vars
,
t
.
globals
,
fail_on_undefined
)
new_context
=
t
.
new_context
(
jvars
,
shared
=
True
)
new_context
=
t
.
new_context
(
jvars
,
shared
=
True
)
rf
=
t
.
root_render_func
(
new_context
)
rf
=
t
.
root_render_func
(
new_context
)
res
=
jinja2
.
utils
.
concat
(
rf
)
try
:
res
=
jinja2
.
utils
.
concat
(
rf
)
except
TypeError
,
te
:
if
'StrictUndefined'
in
str
(
te
):
raise
errors
.
AnsibleUndefinedVariable
(
"unable to look up a name or access an attribute in template string"
)
return
res
return
res
except
(
jinja2
.
exceptions
.
UndefinedError
,
errors
.
AnsibleUndefinedVariable
):
except
(
jinja2
.
exceptions
.
UndefinedError
,
errors
.
AnsibleUndefinedVariable
):
if
fail_on_undefined
:
if
fail_on_undefined
:
...
...
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