mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
remove broken nad commented unicode conversion -- in v2, this is done when the data first enters ansible.
This commit is contained in:
@@ -203,10 +203,6 @@ class Templar:
|
|||||||
def _do_template(self, data, preserve_trailing_newlines=False):
|
def _do_template(self, data, preserve_trailing_newlines=False):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# FIXME: is this even required? it seems to conflict with the lines
|
|
||||||
# below which do the same thing?
|
|
||||||
#if isinstance(data, str):
|
|
||||||
# data = unicode(data, 'utf-8')
|
|
||||||
|
|
||||||
environment = Environment(trim_blocks=True, undefined=StrictUndefined, extensions=self._get_extensions(), finalize=self._finalize)
|
environment = Environment(trim_blocks=True, undefined=StrictUndefined, extensions=self._get_extensions(), finalize=self._finalize)
|
||||||
environment.filters.update(self._get_filters())
|
environment.filters.update(self._get_filters())
|
||||||
@@ -220,13 +216,6 @@ class Templar:
|
|||||||
# if os.path.exists(filesdir):
|
# if os.path.exists(filesdir):
|
||||||
# basedir = filesdir
|
# basedir = filesdir
|
||||||
|
|
||||||
# from issue #6227, make sure unicode is handled properly
|
|
||||||
if isinstance(data, unicode):
|
|
||||||
try:
|
|
||||||
data = data.decode('utf-8')
|
|
||||||
except UnicodeEncodeError, e:
|
|
||||||
pass
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
t = environment.from_string(data)
|
t = environment.from_string(data)
|
||||||
except TemplateSyntaxError, e:
|
except TemplateSyntaxError, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user