[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

@@ -158,7 +158,6 @@ from ansible_collections.community.general.plugins.module_utils.redfish_utils im
RedfishUtils,
REDFISH_COMMON_ARGUMENT_SPEC,
)
from ansible.module_utils.common.text.converters import to_native
class IdracRedfishUtils(RedfishUtils):
@@ -314,7 +313,7 @@ def main():
# execute only if we find a Manager resource
result = rf_utils._find_managers_resource()
if result["ret"] is False:
module.fail_json(msg=to_native(result["msg"]))
module.fail_json(msg=result["msg"])
for command in command_list:
if command in ["SetManagerAttributes", "SetLifecycleControllerAttributes", "SetSystemAttributes"]:
@@ -323,11 +322,11 @@ def main():
# Return data back or fail with proper message
if result["ret"] is True:
if result.get("warning"):
module.warn(to_native(result["warning"]))
module.warn(result["warning"])
module.exit_json(changed=result["changed"], msg=to_native(result["msg"]))
module.exit_json(changed=result["changed"], msg=result["msg"])
else:
module.fail_json(msg=to_native(result["msg"]))
module.fail_json(msg=result["msg"])
if __name__ == "__main__":