fixing errors with utf-8 values
removing utf-8 stanza changing cast to binary_type instead using to_unicode
This commit is contained in:
parent
4d024fc82a
commit
1e5a205389
1 changed files with 2 additions and 1 deletions
|
@ -36,6 +36,7 @@ from ansible.parsing.dataloader import DataLoader
|
||||||
from ansible.playbook.attribute import Attribute, FieldAttribute
|
from ansible.playbook.attribute import Attribute, FieldAttribute
|
||||||
from ansible.utils.boolean import boolean
|
from ansible.utils.boolean import boolean
|
||||||
from ansible.utils.vars import combine_vars, isidentifier
|
from ansible.utils.vars import combine_vars, isidentifier
|
||||||
|
from ansible.utils.unicode import to_unicode
|
||||||
|
|
||||||
BASE_ATTRIBUTES = {}
|
BASE_ATTRIBUTES = {}
|
||||||
|
|
||||||
|
@ -310,7 +311,7 @@ class Base:
|
||||||
# and make sure the attribute is of the type it should be
|
# and make sure the attribute is of the type it should be
|
||||||
if value is not None:
|
if value is not None:
|
||||||
if attribute.isa == 'string':
|
if attribute.isa == 'string':
|
||||||
value = text_type(value)
|
value = text_type(to_unicode(value))
|
||||||
elif attribute.isa == 'int':
|
elif attribute.isa == 'int':
|
||||||
value = int(value)
|
value = int(value)
|
||||||
elif attribute.isa == 'float':
|
elif attribute.isa == 'float':
|
||||||
|
|
Loading…
Reference in a new issue