From dabf74795cf238d0b34e439d9222a1557a7e95c9 Mon Sep 17 00:00:00 2001 From: leondutoit Date: Thu, 18 Apr 2024 18:16:09 +0200 Subject: [PATCH] warn if a backend from config is not supported, change form_data to sns for consistency --- tsdfileapi/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tsdfileapi/api.py b/tsdfileapi/api.py index edacda4..8f80be5 100644 --- a/tsdfileapi/api.py +++ b/tsdfileapi/api.py @@ -2861,7 +2861,7 @@ class Backends: ), ("/v1/(.*)/survey", GenericTableHandler, dict(backend="survey")), ], - "form_data": [ + "sns": [ ("/v1/(.*)/sns/(.*)/(.*)", SnsFormDataHandler, dict(backend="sns")), ], "publication": [ @@ -2959,6 +2959,9 @@ def __init__(self, config: dict) -> None: for route in self.optional_routes[backend]: print(colored(f"- {route[0]}", "yellow")) self.routes.append(route) + else: + # TODO: change to exit once config has been cleaned + logger.warning(f"Unknown backend in config: {backend}") db_backends = self.config["backends"]["dbs"].items() if db_backends: