1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #3731 from bcoca/jinja_override_typed

now correctly 'types' value pairs that are passed to jinja overrides
This commit is contained in:
Michael DeHaan 2013-08-01 18:54:22 -07:00
commit cb028b94a4

View file

@ -28,6 +28,7 @@ import time
import subprocess import subprocess
import datetime import datetime
import pwd import pwd
import ast
class Globals(object): class Globals(object):
@ -435,7 +436,7 @@ def template_from_file(basedir, path, vars):
data = data[eol+1:] data = data[eol+1:]
for pair in line.split(','): for pair in line.split(','):
(key,val) = pair.split(':') (key,val) = pair.split(':')
setattr(environment,key.strip(),val.strip()) setattr(environment,key.strip(),ast.literal_eval(val.strip()))
environment.template_class = J2Template environment.template_class = J2Template
t = environment.from_string(data) t = environment.from_string(data)