From cd73f77414586fed66c5d7d81d57448ff1f0b54e Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 16 Aug 2018 14:54:40 -0400 Subject: Fix handling of socket connection refusal. Currently if the socket was never started you get an error about the service being started. But if the service was started and later stopped, you get a useless error. This change causes the error to always be the same for connection refused. The error message was also repeating the address twice which looked bad. Signed-off-by: Daniel J Walsh Closes: #1287 Approved by: baude --- contrib/python/podman/podman/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/python/podman') diff --git a/contrib/python/podman/podman/client.py b/contrib/python/podman/podman/client.py index 327bfdee2..b61506cda 100644 --- a/contrib/python/podman/podman/client.py +++ b/contrib/python/podman/podman/client.py @@ -175,12 +175,12 @@ class Client(): if not System(self._client).ping(): raise ConnectionRefusedError( errno.ECONNREFUSED, - 'Failed varlink connection "{}"'.format(address), address) + ('Failed varlink connection "{}"').format(address)) except FileNotFoundError: raise ConnectionError( errno.ECONNREFUSED, ('Failed varlink connection "{}".' - ' Is podman service running?').format(address), address) + ' Is podman socket or service running?').format(address)) def __enter__(self): """Return `self` upon entering the runtime context.""" -- cgit v1.2.3-54-g00ecf