From 00e5e2a0b1d56527322a2de3e97ceec95d05ec33 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 5 Jan 2021 17:07:33 +0200 Subject: [PATCH] Fix loading services --- apiserver/service_repo/service_repo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apiserver/service_repo/service_repo.py b/apiserver/service_repo/service_repo.py index 5782f39..b1cf4aa 100644 --- a/apiserver/service_repo/service_repo.py +++ b/apiserver/service_repo/service_repo.py @@ -79,7 +79,7 @@ class ServiceRepo(object): @classmethod def load(cls, root_module="services"): - root_module = Path(root_module) + root_module = Path(__file__).parents[1] / root_module sub_module = None for sub_module in root_module.glob("*"): if ( @@ -87,9 +87,9 @@ class ServiceRepo(object): and sub_module.suffix == ".py" and not sub_module.stem == "__init__" ): - import_module(f"{root_module.stem}.{sub_module.stem}") + import_module(f"apiserver.{root_module.stem}.{sub_module.stem}") if sub_module.is_dir(): - import_module(f"{root_module.stem}.{sub_module.stem}") + import_module(f"apiserver.{root_module.stem}.{sub_module.stem}") # leave no trace of the 'sub_module' local del sub_module