mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #31723 In python3, ansible's fetch_url utility function wraps urllib.request.urlopen. For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse object slightly modified. Calling .read() on an HTTPResponse object returns bytes (note the docstring fix). Here, to_native is used to convert the bytestrings returned by fetch_url into unicode strings. This is necessary because: 1. Pre python3.6, json.loads requires passing a string, not a bytestring, as its argument 2. In python3 generally, testing if a string is a substring of a bytestring using the 'in' operator will raise a TypeError see: - https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen - https://docs.python.org/3/library/http.client.html#http.client.HTTPResponse.read - https://docs.python.org/3/library/json.html#json.loads |
||
---|---|---|
.. | ||
aws | ||
facts | ||
network | ||
parsing | ||
powershell | ||
remote_management | ||
six | ||
__init__.py | ||
_text.py | ||
ansible_tower.py | ||
api.py | ||
azure_rm_common.py | ||
basic.py | ||
cloud.py | ||
cloudscale.py | ||
cloudstack.py | ||
connection.py | ||
crypto.py | ||
database.py | ||
digital_ocean.py | ||
dimensiondata.py | ||
docker_common.py | ||
ec2.py | ||
exoscale.py | ||
f5_utils.py | ||
gcdns.py | ||
gce.py | ||
gcp.py | ||
infinibox.py | ||
influxdb.py | ||
ipa.py | ||
ismount.py | ||
json_utils.py | ||
k8s_common.py | ||
keycloak.py | ||
known_hosts.py | ||
lxd.py | ||
manageiq.py | ||
mysql.py | ||
netapp.py | ||
oneview.py | ||
openshift_common.py | ||
openstack.py | ||
ovirt.py | ||
postgres.py | ||
pure.py | ||
pycompat24.py | ||
rax.py | ||
redhat.py | ||
service.py | ||
splitter.py | ||
univention_umc.py | ||
urls.py | ||
vca.py | ||
vmware.py | ||
vultr.py |