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:
parent
75a7ebe900
commit
ec14572a60
1 changed files with 6 additions and 0 deletions
|
@ -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 AnsibleUnicode, AnsibleSequence, AnsibleMapping
|
||||||
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
|
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
|
||||||
from ansible.vars.hostvars import HostVars
|
from ansible.vars.hostvars import HostVars
|
||||||
|
from ansible.vars.unsafe_proxy import AnsibleUnsafeText
|
||||||
|
|
||||||
|
|
||||||
class AnsibleDumper(yaml.SafeDumper):
|
class AnsibleDumper(yaml.SafeDumper):
|
||||||
|
@ -51,6 +52,11 @@ AnsibleDumper.add_representer(
|
||||||
represent_unicode,
|
represent_unicode,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AnsibleDumper.add_representer(
|
||||||
|
AnsibleUnsafeText,
|
||||||
|
represent_unicode,
|
||||||
|
)
|
||||||
|
|
||||||
AnsibleDumper.add_representer(
|
AnsibleDumper.add_representer(
|
||||||
HostVars,
|
HostVars,
|
||||||
represent_hostvars,
|
represent_hostvars,
|
||||||
|
|
Loading…
Reference in a new issue