From 9b8867399ecf082d070b9da31301f470e09def78 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Thu, 13 Nov 2025 09:42:52 +1300 Subject: [PATCH] replace batch of redundant to_native()/to_text() occurrences (#11105) * replace batch of redundant to_native()/to_text() occurrences * add changelog frag --- changelogs/fragments/11105-tonative-4.yml | 4 ++++ plugins/modules/cobbler_sync.py | 3 +-- plugins/modules/cobbler_system.py | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/11105-tonative-4.yml diff --git a/changelogs/fragments/11105-tonative-4.yml b/changelogs/fragments/11105-tonative-4.yml new file mode 100644 index 0000000000..1bd0db9ec9 --- /dev/null +++ b/changelogs/fragments/11105-tonative-4.yml @@ -0,0 +1,4 @@ +minor_changes: + - cobbler_sync - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105). + - cobbler_system - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105). + - ip_netns - remove redundant conversions to unicode (https://github.com/ansible-collections/community.general/pull/11105). diff --git a/plugins/modules/cobbler_sync.py b/plugins/modules/cobbler_sync.py index 7e2e9a72a4..5979ece600 100644 --- a/plugins/modules/cobbler_sync.py +++ b/plugins/modules/cobbler_sync.py @@ -74,7 +74,6 @@ import ssl import xmlrpc.client as xmlrpc_client from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.text.converters import to_text from ansible_collections.community.general.plugins.module_utils.datetime import ( now, @@ -120,7 +119,7 @@ def main(): except xmlrpc_client.Fault as e: module.fail_json( msg="Failed to log in to Cobbler '{url}' as '{username}'. {error}".format( - url=url, error=to_text(e), **module.params + url=url, error=f"{e}", **module.params ) ) except Exception as e: diff --git a/plugins/modules/cobbler_system.py b/plugins/modules/cobbler_system.py index 3662b2ac3a..6a503ca507 100644 --- a/plugins/modules/cobbler_system.py +++ b/plugins/modules/cobbler_system.py @@ -151,7 +151,6 @@ import ssl import xmlrpc.client as xmlrpc_client from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.text.converters import to_text from ansible_collections.community.general.plugins.module_utils.datetime import ( now, @@ -241,7 +240,7 @@ def main(): except xmlrpc_client.Fault as e: module.fail_json( msg="Failed to log in to Cobbler '{url}' as '{username}'. {error}".format( - url=url, error=to_text(e), **module.params + url=url, error=f"{e}", **module.params ) ) except Exception as e: