summaryrefslogtreecommitdiff
path: root/contrib/python/podman/client.py
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2018-05-21 16:31:36 -0700
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-23 17:54:09 +0000
commit5f0d4b10e9b5ea18e91090e82ddfb22f63b06635 (patch)
tree0a308dd23c0f1c2149f8d597224ba73440bf793d /contrib/python/podman/client.py
parentc1efde20e01f255b1186d6958371da4f5401310a (diff)
downloadpodman-5f0d4b10e9b5ea18e91090e82ddfb22f63b06635.tar.gz
podman-5f0d4b10e9b5ea18e91090e82ddfb22f63b06635.tar.bz2
podman-5f0d4b10e9b5ea18e91090e82ddfb22f63b06635.zip
Add support for Zulu timestamp parsing
- Improve error message when podman varlink service is not running Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #800 Approved by: rhatdan
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."""