[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
22 changed files with 68 additions and 58 deletions

View File

@@ -101,7 +101,6 @@ RETURN = r"""
import json
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import fetch_url
@@ -129,7 +128,7 @@ def query(module, url, check, subscription):
module.fail_json(msg="Failed to query silence %s. Reason: %s" % (subscription, info))
try:
json_out = json.loads(to_native(response.read()))
json_out = json.loads(response.read())
except Exception:
json_out = ""
@@ -176,7 +175,7 @@ def clear(module, url, check, subscription):
module.fail_json(msg="Failed to silence %s. Reason: %s" % (subscription, info))
try:
json_out = json.loads(to_native(response.read()))
json_out = json.loads(response.read())
except Exception:
json_out = ""
@@ -225,7 +224,7 @@ def create(module, url, check, creator, expire, expire_on_resolve, reason, subsc
module.fail_json(msg="Failed to silence %s. Reason: %s" % (subscription, info["msg"]))
try:
json_out = json.loads(to_native(response.read()))
json_out = json.loads(response.read())
except Exception:
json_out = ""