mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-04 07:51:50 +00:00
replace batch of redundant to_native()/to_text() occurrences (#11105)
* replace batch of redundant to_native()/to_text() occurrences * add changelog frag
This commit is contained in:
parent
4171b8a9ab
commit
9b8867399e
3 changed files with 6 additions and 4 deletions
|
|
@ -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