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

@@ -135,7 +135,7 @@ import tempfile
import typing as t
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.common.text.converters import to_text
from ansible_collections.community.crypto.plugins.module_utils._crypto.math import (
count_bits,
)
@@ -298,7 +298,7 @@ class DHParameterOpenSSL(DHParameterBase):
self.path,
]
rc, out, err = module.run_command(command, check_rc=False)
result = to_native(out)
result = to_text(out)
if rc != 0:
# If the call failed the file probably does not exist or is
# unreadable
@@ -311,7 +311,7 @@ class DHParameterOpenSSL(DHParameterBase):
bits = int(match.group(1))
# if output contains "WARNING" we've got a problem
if "WARNING" in result or "WARNING" in to_native(err):
if "WARNING" in result or "WARNING" in to_text(err):
return False
return bits == self.size