1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add troubleshooting URL for persistent socket path related issue (#38542)

* Add troubleshooting URL for persistent socket path related issue

socket path timeout related error messages are not displayed on the
console as the ansible-connection process does not have access to it.
Until this is fixed need to point to troubleshooting URL so that
users can take corrective actions.

* Fix CI issue
This commit is contained in:
Ganesh Nalawade 2018-04-11 11:23:23 +05:30 committed by GitHub
parent 72b0ed8cb4
commit 53d3e7e306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,8 +111,10 @@ class Connection(object):
req = request_builder(name, *args, **kwargs)
reqid = req['id']
troubleshoot = 'http://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#category-socket-path-issue'
if not os.path.exists(self.socket_path):
raise ConnectionError('socket_path does not exist or cannot be found')
raise ConnectionError('socket_path does not exist or cannot be found. Please check %s' % troubleshoot)
try:
data = json.dumps(req)
@ -120,7 +122,8 @@ class Connection(object):
response = json.loads(out)
except socket.error as e:
raise ConnectionError('unable to connect to socket', err=to_text(e, errors='surrogate_then_replace'), exception=traceback.format_exc())
raise ConnectionError('unable to connect to socket. Please check %s' % troubleshoot, err=to_text(e, errors='surrogate_then_replace'),
exception=traceback.format_exc())
if response['id'] != reqid:
raise ConnectionError('invalid json-rpc id received')