1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-20 10:48:59 +00:00

[PR #11143/23e81b8d backport][stable-12] replace redundant to_native()/to_text() occurrences, batch 8 (#11164)

replace redundant to_native()/to_text() occurrences, batch 8 (#11143)

* replace redundant to_native()/to_text() occurrences, batch 8

* add changelog frag

* Update plugins/modules/jira.py



---------


(cherry picked from commit 23e81b8d30)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2025-11-16 07:09:40 +01:00 committed by GitHub
parent 15d4fff749
commit 8a7f360558
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 68 additions and 58 deletions

View file

@ -342,7 +342,6 @@ from urllib.parse import urlencode
from ansible.module_utils.basic import AnsibleModule, to_bytes
from ansible.module_utils.urls import fetch_url, url_argument_spec, basic_auth_header
from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.general.plugins.module_utils.jenkins import download_updates_file
@ -399,7 +398,7 @@ class JenkinsPlugin:
# Parse the JSON data
try:
json_data = json.loads(to_native(r.read()))
json_data = json.loads(r.read())
except Exception as e:
self.module.fail_json(msg=f"Cannot parse {what} JSON data.", details=f"{e}")
@ -683,7 +682,7 @@ class JenkinsPlugin:
now = time.time()
if now - file_mtime >= 86400:
response = self._get_urls_data(plugin_version_urls, what="plugin-versions.json")
plugin_data = json.loads(to_native(response.read()), object_pairs_hook=OrderedDict)
plugin_data = json.loads(response.read(), object_pairs_hook=OrderedDict)
# Save it to file for next time
with open(cache_path, "w") as f: