mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
jinja2 cannot handle byte strs with non-ascii. So we need to transform potential byte str into unicode type. This fix is for dynamic inventory.
Fixes #10007
This commit is contained in:
parent
2f1fc3e042
commit
915d232d5f
5 changed files with 42 additions and 4 deletions
|
@ -22,7 +22,7 @@ import subprocess
|
|||
import ansible.constants as C
|
||||
from ansible.inventory.host import Host
|
||||
from ansible.inventory.group import Group
|
||||
from ansible.module_utils.basic import json_dict_unicode_to_bytes
|
||||
from ansible.module_utils.basic import json_dict_bytes_to_unicode
|
||||
from ansible import utils
|
||||
from ansible import errors
|
||||
import sys
|
||||
|
@ -59,7 +59,7 @@ class InventoryScript(object):
|
|||
|
||||
# not passing from_remote because data from CMDB is trusted
|
||||
self.raw = utils.parse_json(self.data)
|
||||
self.raw = json_dict_unicode_to_bytes(self.raw)
|
||||
self.raw = json_dict_bytes_to_unicode(self.raw)
|
||||
|
||||
all = Group('all')
|
||||
groups = dict(all=all)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue