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:
parent
8b5a44a50d
commit
bde0c0f679
1 changed files with 8 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue