mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 22:51:23 -07:00
Transform exception with to_native instead of str
This commit is contained in:
parent
3fe8f70b08
commit
ad1e066540
1 changed files with 2 additions and 2 deletions
|
@ -115,7 +115,7 @@ import ansible.module_utils.six.moves.urllib.request as urllib_request
|
||||||
import ansible.module_utils.six.moves.urllib.error as urllib_error
|
import ansible.module_utils.six.moves.urllib.error as urllib_error
|
||||||
from ansible.module_utils.basic import get_distribution, get_exception
|
from ansible.module_utils.basic import get_distribution, get_exception
|
||||||
from ansible.module_utils.six import b
|
from ansible.module_utils.six import b
|
||||||
from ansible.module_utils._text import to_bytes
|
from ansible.module_utils._text import to_bytes, to_native
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# python3
|
# python3
|
||||||
|
@ -725,7 +725,7 @@ class SSLValidationHandler(urllib_request.BaseHandler):
|
||||||
build_ssl_validation_error(self.hostname, self.port, paths_checked)
|
build_ssl_validation_error(self.hostname, self.port, paths_checked)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
e = get_exception()
|
e = get_exception()
|
||||||
raise ConnectionError('Failed to connect to %s at port %s: %s' % (self.hostname, self.port, str(e)))
|
raise ConnectionError('Failed to connect to %s at port %s: %s' % (self.hostname, self.port, to_native(e)))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# cleanup the temp file created, don't worry
|
# cleanup the temp file created, don't worry
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue