Merge pull request #362 from jhoekx/uppercase-vars

Allow camelCase variables in varReplace.
pull/368/merge
Michael DeHaan 13 years ago
commit abb391f3fd

@ -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())

@ -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 = {

Loading…
Cancel
Save