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
db145a36
Commit
db145a36
authored
Nov 25, 2014
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now only flattened ignores failonundefined cause of it's special need
parent
e3feb104
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lib/ansible/runner/lookup_plugins/flattened.py
+1
-1
lib/ansible/utils/__init__.py
+2
-2
No files found.
lib/ansible/runner/lookup_plugins/flattened.py
View file @
db145a36
...
...
@@ -50,7 +50,7 @@ class LookupModule(object):
if
isinstance
(
term
,
basestring
):
# convert a variable to a list
term2
=
utils
.
listify_lookup_plugin_terms
(
term
,
self
.
basedir
,
inject
)
term2
=
utils
.
listify_lookup_plugin_terms
(
term
,
self
.
basedir
,
inject
,
fail_on_undefined
=
False
)
# but avoid converting a plain string to a list of one string
if
term2
!=
[
term
]:
term
=
term2
...
...
lib/ansible/utils/__init__.py
View file @
db145a36
...
...
@@ -1451,7 +1451,7 @@ def safe_eval(expr, locals={}, include_exceptions=False):
return
expr
def
listify_lookup_plugin_terms
(
terms
,
basedir
,
inject
):
def
listify_lookup_plugin_terms
(
terms
,
basedir
,
inject
,
fail_on_undefined
=
C
.
DEFAULT_UNDEFINED_VAR_BEHAVIOR
):
from
ansible.utils
import
template
...
...
@@ -1469,7 +1469,7 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
# if not already a list, get ready to evaluate with Jinja2
# not sure why the "/" is in above code :)
try
:
new_terms
=
template
.
template
(
basedir
,
"{{
%
s}}"
%
terms
,
inject
,
convert_bare
=
True
)
new_terms
=
template
.
template
(
basedir
,
"{{
%
s}}"
%
terms
,
inject
,
convert_bare
=
True
,
fail_on_undefined
=
fail_on_undefined
)
if
isinstance
(
new_terms
,
basestring
)
and
"{{"
in
new_terms
:
pass
else
:
...
...
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