1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #11105/9b886739 backport][stable-12] replace batch of redundant to_native()/to_text() occurrences (#11139)

replace batch of redundant to_native()/to_text() occurrences (#11105)

* replace batch of redundant to_native()/to_text() occurrences

* add changelog frag

(cherry picked from commit 9b8867399e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-11-12 21:59:03 +01:00 committed by GitHub
parent 31f0087da9
commit 4b9ece4fbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -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).

View file

@ -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:

View file

@ -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: