Skip to content

Commit

Permalink
fix: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren committed Nov 21, 2024
1 parent 341def1 commit 34ec900
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions keep/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import keep.api.logging
import keep.api.observability
import keep.api.utils.import_ee
from keep.api.arq_worker import get_arq_worker
from keep.api.consts import (
KEEP_ARQ_QUEUE_BASIC,
Expand Down
17 changes: 9 additions & 8 deletions keep/identitymanager/identitymanagerfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ def _load_manager(manager_type: str, manager_class: str, *args, **kwargs):
)
# look for the module in ee
except ModuleNotFoundError:
module = importlib.import_module(
f"ee.identitymanager.identity_managers.{manager_type}.{manager_type}_{manager_class}"
)
except ModuleNotFoundError:
raise NotImplementedError(
f"{manager_class.__name__} for {manager_type} not implemented"
)
try:
module = importlib.import_module(
f"ee.identitymanager.identity_managers.{manager_type}.{manager_type}_{manager_class}"
)
except ModuleNotFoundError:
raise NotImplementedError(

Check warning on line 113 in keep/identitymanager/identitymanagerfactory.py

View check run for this annotation

Codecov / codecov/patch

keep/identitymanager/identitymanagerfactory.py#L112-L113

Added lines #L112 - L113 were not covered by tests
f"{manager_class} for {manager_type} not implemented"
)
# look for the class that contains the manager_class in its name
for _attr in dir(module):
if manager_class in _attr.lower() and "base" not in _attr.lower():
Expand All @@ -121,7 +122,7 @@ def _load_manager(manager_type: str, manager_class: str, *args, **kwargs):
return manager_class(*args, **kwargs)
except (ImportError, AttributeError):
raise NotImplementedError(
f"{manager_class.__name__} for {manager_type} not implemented"
f"{manager_class} for {manager_type} not implemented"
)

@staticmethod
Expand Down

0 comments on commit 34ec900

Please sign in to comment.