mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 10:56:48 +00:00
Fix loading services
This commit is contained in:
parent
37e5d8a7e0
commit
00e5e2a0b1
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user