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:
parent
31f0087da9
commit
4b9ece4fbd
3 changed files with 6 additions and 4 deletions
4
changelogs/fragments/11105-tonative-4.yml
Normal file
4
changelogs/fragments/11105-tonative-4.yml
Normal 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).
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue