Not native, but text (#55676)

* use to_text instead of to_native
* cleaned up some imports and other pyflakisms
* fix missing lib messages
This commit is contained in:
Brian Coca
2019-05-24 14:49:04 -04:00
committed by GitHub
parent 6e66ea9f78
commit 27dcf8aaab
12 changed files with 33 additions and 35 deletions

View File

@@ -27,7 +27,6 @@ import pwd
import re
import time
from functools import wraps
from numbers import Number
try:
@@ -809,7 +808,7 @@ class Templar:
errmsg += "Make sure your variable name does not contain invalid characters like '-': %s" % to_native(te)
raise AnsibleUndefinedVariable(errmsg)
else:
display.debug("failing because of a type error, template data is: %s" % to_native(data))
display.debug("failing because of a type error, template data is: %s" % to_text(data))
raise AnsibleError("Unexpected templating type error occurred on (%s): %s" % (to_native(data), to_native(te)))
if USE_JINJA2_NATIVE and not isinstance(res, string_types):