mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-07 20:47:16 +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:
parent
15d4fff749
commit
8a7f360558
22 changed files with 68 additions and 58 deletions
|
|
@ -115,8 +115,7 @@ def is_csrf_protection_enabled(module):
|
|||
if info["status"] != 200:
|
||||
module.fail_json(msg=f"HTTP error {info['status']} {info['msg']}", output="")
|
||||
|
||||
content = to_native(resp.read())
|
||||
return json.loads(content).get("useCrumbs", False)
|
||||
return json.loads(resp.read()).get("useCrumbs", False)
|
||||
|
||||
|
||||
def get_crumb(module, cookies):
|
||||
|
|
@ -130,8 +129,7 @@ def get_crumb(module, cookies):
|
|||
if info["status"] != 200:
|
||||
module.fail_json(msg=f"HTTP error {info['status']} {info['msg']}", output="")
|
||||
|
||||
content = to_native(resp.read())
|
||||
return json.loads(content)
|
||||
return json.loads(resp.read())
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue