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

@@ -279,7 +279,7 @@ from ssl import (
)
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.cryptography_support import (
CRYPTOGRAPHY_TIMEZONE,
cryptography_get_extensions_from_cert,
@@ -419,7 +419,7 @@ def main() -> t.NoReturn:
# If the item is a string_type
if isinstance(tls_ctx_option, (str, bytes)):
# Convert tls_ctx_option to a native string
tls_ctx_option_str = to_native(tls_ctx_option)
tls_ctx_option_str = to_text(tls_ctx_option)
# Get the tls_ctx_option_str attribute from ssl
tls_ctx_option_attr = getattr(ssl, tls_ctx_option_str, None)
# If tls_ctx_option_attr is an integer