summaryrefslogtreecommitdiff
path: root/contrib/python/podman/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/python/podman/client.py')
-rw-r--r--contrib/python/podman/client.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/python/podman/client.py b/contrib/python/podman/client.py
index 8a1acdd9b..c6112aae8 100644
--- a/contrib/python/podman/client.py
+++ b/contrib/python/podman/client.py
@@ -53,9 +53,14 @@ class Client(object):
self._client = functools.partial(_podman, uri, interface)
# Quick validation of connection data provided
- if not System(self._client).ping():
- raise ValueError('Failed varlink connection "{}/{}"'.format(
- uri, interface))
+ try:
+ if not System(self._client).ping():
+ raise ValueError('Failed varlink connection "{}/{}"'.format(
+ uri, interface))
+ except FileNotFoundError:
+ raise ValueError('Failed varlink connection "{}/{}".'
+ ' Is podman service running?'.format(
+ uri, interface))
def __enter__(self):
"""Return `self` upon entering the runtime context."""