Replace to_native with to_text. (#897)

This commit is contained in:
Felix Fontein
2025-05-18 01:31:33 +02:00
committed by GitHub
parent 9b8e4e81a9
commit 7294841a28
19 changed files with 48 additions and 48 deletions

View File

@@ -282,7 +282,7 @@ import traceback
import typing as t
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_bytes, to_native
from ansible.module_utils.common.text.converters import to_bytes, to_text
from ansible_collections.community.crypto.plugins.module_utils._crypto.basic import (
OpenSSLBadPassphraseError,
OpenSSLObjectError,
@@ -559,7 +559,7 @@ class Pkcs(OpenSSLObject):
expected_content = to_bytes(
"".join(
[
to_native(pem)
to_text(pem)
for pem in [pkey, cert] + other_certs
if pem is not None
]
@@ -848,7 +848,7 @@ def main() -> t.NoReturn:
pkey, cert, other_certs, _friendly_name = pkcs12.parse()
dump_content = "".join(
[
to_native(pem)
to_text(pem)
for pem in [pkey, cert] + other_certs
if pem is not None
]