mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
✨ Add an error message if the connection to the Docker daemon fails
This commit is contained in:
parent
8b5a44a50d
commit
bde0c0f679
1 changed files with 8 additions and 2 deletions
|
@ -2,12 +2,18 @@ import enum
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
import docker.errors
|
||||||
import docker.models.containers
|
import docker.models.containers
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
log.info("Connecting to Docker daemon...")
|
log.info("Connecting to Docker daemon...")
|
||||||
|
try:
|
||||||
client: docker.DockerClient = docker.from_env()
|
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!")
|
log.info("Connection to Docker daemon successful!")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue