mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
Do not use str() on exceptions (#46950)
This commit is contained in:
parent
2436aa1a4e
commit
a80c25cbd9
30 changed files with 76 additions and 66 deletions
|
@ -23,7 +23,7 @@ import json
|
|||
import re
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.module_utils._text import to_text, to_bytes
|
||||
from ansible.module_utils._text import to_text, to_bytes, to_native
|
||||
from ansible.errors import AnsibleConnectionFailure, AnsibleError
|
||||
from ansible.plugins.netconf import NetconfBase
|
||||
from ansible.plugins.netconf import ensure_connected
|
||||
|
@ -120,7 +120,7 @@ class Netconf(NetconfBase):
|
|||
timeout=obj._play_context.timeout
|
||||
)
|
||||
except SSHUnknownHostError as exc:
|
||||
raise AnsibleConnectionFailure(str(exc))
|
||||
raise AnsibleConnectionFailure(to_native(exc))
|
||||
|
||||
guessed_os = None
|
||||
for c in m.server_capabilities:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue