mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Change $FILE{} and $PIPE{} to $FILE() and $PIPE()
This commit is contained in:
committed by
Daniel Hokka Zakrisson
parent
cc948f339c
commit
4ded8cb3b3
@@ -220,7 +220,7 @@ def varReplace(raw, vars):
|
|||||||
|
|
||||||
return ''.join(done)
|
return ''.join(done)
|
||||||
|
|
||||||
_FILEPIPECRE = re.compile(r"\$(?P<special>FILE|PIPE)\{([^\}]+)\}")
|
_FILEPIPECRE = re.compile(r"\$(?P<special>FILE|PIPE)\(([^\}]+)\)")
|
||||||
def varReplaceFilesAndPipes(basedir, raw):
|
def varReplaceFilesAndPipes(basedir, raw):
|
||||||
done = [] # Completed chunks to return
|
done = [] # Completed chunks to return
|
||||||
|
|
||||||
|
|||||||
@@ -214,14 +214,14 @@ class TestUtils(unittest.TestCase):
|
|||||||
assert res == u'hello oh great one'
|
assert res == u'hello oh great one'
|
||||||
|
|
||||||
def test_varReplace_include(self):
|
def test_varReplace_include(self):
|
||||||
template = 'hello $FILE{world}'
|
template = 'hello $FILE(world)'
|
||||||
|
|
||||||
res = ansible.utils.template("test", template, {})
|
res = ansible.utils.template("test", template, {})
|
||||||
|
|
||||||
assert res == u'hello world\n'
|
assert res == u'hello world\n'
|
||||||
|
|
||||||
def test_varReplace_include_script(self):
|
def test_varReplace_include_script(self):
|
||||||
template = 'hello $PIPE{echo world}'
|
template = 'hello $PIPE(echo world)'
|
||||||
|
|
||||||
res = ansible.utils.template("test", template, {})
|
res = ansible.utils.template("test", template, {})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user