serve: Add check that all devices in config exist

This commit is contained in:
rlaphoenix 2022-08-01 23:40:08 +01:00
parent 2ba13f5e07
commit 4f96ee402b
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ async def _startup(app: web.Application):
for x in app["config"]["devices"] for x in app["config"]["devices"]
for path in [Path(x)] for path in [Path(x)]
} }
for device in app["config"]["devices"].values():
if not device.is_file():
raise FileNotFoundError(f"Device file does not exist: {device}")
async def _cleanup(app: web.Application): async def _cleanup(app: web.Application):