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
abb391f3
Commit
abb391f3
authored
May 11, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #362 from jhoekx/uppercase-vars
Allow camelCase variables in varReplace.
parents
277ff4f5
0b5b4485
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
+11
-1
lib/ansible/utils.py
+1
-1
test/TestUtils.py
+10
-0
No files found.
lib/ansible/utils.py
View file @
abb391f3
...
...
@@ -243,7 +243,7 @@ def varReplace(raw, vars):
# Determine replacement value (if unknown variable then preserve
# original)
varname
=
m
.
group
(
2
)
.
lower
()
varname
=
m
.
group
(
2
)
replacement
=
unicode
(
varLookup
(
varname
,
vars
)
or
m
.
group
())
...
...
test/TestUtils.py
View file @
abb391f3
...
...
@@ -45,6 +45,16 @@ class TestUtils(unittest.TestCase):
assert
res
==
'hello world'
def
test_varReplace_caps
(
self
):
template
=
'hello $whoVar'
vars
=
{
'whoVar'
:
'world'
,
}
res
=
ansible
.
utils
.
varReplace
(
template
,
vars
)
print
res
assert
res
==
'hello world'
def
test_varReplace_middle
(
self
):
template
=
'hello $who!'
vars
=
{
...
...
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