mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Fix some templating issues, needs testing with anti-unicode safeguard around shlex.split
This commit is contained in:
parent
bd7de28a64
commit
b76efa39be
3 changed files with 6 additions and 5 deletions
|
@ -204,7 +204,7 @@ def template(text, vars):
|
|||
if (depth > 20):
|
||||
raise errors.AnsibleError("template recursion depth exceeded")
|
||||
prev_text = text
|
||||
text = varReplace(unicode(text), vars)
|
||||
text = varReplace(unicode(text), vars)
|
||||
return text
|
||||
|
||||
def template_from_file(basedir, path, vars):
|
||||
|
@ -238,10 +238,11 @@ def parse_kv(args):
|
|||
|
||||
options = {}
|
||||
if args is not None:
|
||||
vargs = shlex.split(args, posix=True)
|
||||
# attempting to split a unicode here does bad things
|
||||
vargs = shlex.split(str(args), posix=True)
|
||||
for x in vargs:
|
||||
if x.find("=") != -1:
|
||||
k, v = x.split("=", 1)
|
||||
k, v = x.split("=",1)
|
||||
options[k]=v
|
||||
return options
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue