1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

Add an error message if the connection to the Docker daemon fails

This commit is contained in:
Steffo 2021-09-10 17:55:13 +02:00
parent 8b5a44a50d
commit bde0c0f679

View file

@ -2,13 +2,19 @@ import enum
import logging
import time
import docker.errors
import docker.models.containers
log = logging.getLogger(__name__)
log.info("Connecting to Docker daemon...")
client: docker.DockerClient = docker.from_env()
log.info("Connection to Docker daemon successful!")
try:
client: docker.DockerClient = docker.from_env()
except docker.errors.DockerException as e:
log.fatal("Could not connect to the Docker daemon!")
raise
else:
log.info("Connection to Docker daemon successful!")
class HealthState(enum.IntEnum):