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
e74ffd67
Commit
e74ffd67
authored
Nov 14, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lookup plugin arguments need to be templated
parent
44af1408
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
lib/ansible/utils/template.py
+2
-0
test/TestUtils.py
+2
-2
No files found.
lib/ansible/utils/template.py
View file @
e74ffd67
...
...
@@ -157,6 +157,8 @@ def _varFind(basedir, text, vars, depth=0):
if
lookup_plugin_name
==
'LOOKUP'
:
lookup_plugin_name
,
args
=
args
.
split
(
","
,
1
)
args
=
args
.
strip
()
# args have to be templated
args
=
varReplace
(
basedir
,
args
,
vars
,
depth
=
depth
+
1
,
expand_lists
=
True
)
instance
=
utils
.
plugins
.
lookup_loader
.
get
(
lookup_plugin_name
.
lower
(),
basedir
=
basedir
)
if
instance
is
not
None
:
replacement
=
instance
.
run
(
args
,
inject
=
vars
)
...
...
test/TestUtils.py
View file @
e74ffd67
...
...
@@ -272,9 +272,9 @@ class TestUtils(unittest.TestCase):
assert
res
==
u'hello oh great one'
def
test_varReplace_include
(
self
):
template
=
'hello $FILE(world) $LOOKUP(file,
world
)'
template
=
'hello $FILE(world) $LOOKUP(file,
$filename
)'
res
=
ansible
.
utils
.
template
(
"test"
,
template
,
{},
expand_lists
=
True
)
res
=
ansible
.
utils
.
template
(
"test"
,
template
,
{
'filename'
:
'world'
},
expand_lists
=
True
)
assert
res
==
u'hello world world'
...
...
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