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

Add representer to AnsibleDumper for AnsibleUnsafeText

Fixes #20253
Fixes #20290
This commit is contained in:
James Cammarata 2017-01-18 19:35:24 -06:00
parent 75a7ebe900
commit ec14572a60

View file

@ -25,6 +25,7 @@ from ansible.compat.six import PY3
from ansible.parsing.yaml.objects import AnsibleUnicode, AnsibleSequence, AnsibleMapping
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
from ansible.vars.hostvars import HostVars
from ansible.vars.unsafe_proxy import AnsibleUnsafeText
class AnsibleDumper(yaml.SafeDumper):
@ -51,6 +52,11 @@ AnsibleDumper.add_representer(
represent_unicode,
)
AnsibleDumper.add_representer(
AnsibleUnsafeText,
represent_unicode,
)
AnsibleDumper.add_representer(
HostVars,
represent_hostvars,