Skip to content

Commit

Permalink
do it different
Browse files Browse the repository at this point in the history
  • Loading branch information
mishaschwartz committed Dec 13, 2024
1 parent cf106ef commit 5803793
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
2 changes: 0 additions & 2 deletions cowbird/api/webhooks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def dispatch(handler_fct: Callable[[Handler], None]) -> None:
try:
LOGGER.info("Dispatching event [%s] for handler [%s].", event_name, handler.name)
handler_fct(handler)
except NotImplementedError:
LOGGER.debug("Event [%s] for handler [%s] is not implemented.", event_name, handler.name)
except Exception as exception: # noqa
exceptions.append(exception)
LOGGER.error("Exception raised while handling event [%s] for handler [%s] : [%r].",
Expand Down
6 changes: 3 additions & 3 deletions cowbird/handlers/impl/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def user_deleted(self, user_name: str) -> None:
Monitoring().unregister(self._user_workspace_dir(user_name), self)

def permission_created(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_created] for handler [%s] is not implemented", self.name)

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_deleted] for handler [%s] is not implemented", self.name)

@staticmethod
def get_instance() -> Optional["Catalog"]:
Expand Down Expand Up @@ -74,4 +74,4 @@ def on_modified(self, path: str) -> None:

def resync(self) -> None:
# FIXME: this should be implemented in the eventual task addressing the resync mechanism.
raise NotImplementedError
LOGGER.debug("Event [resync] for handler [%s] is not implemented", self.name)
2 changes: 1 addition & 1 deletion cowbird/handlers/impl/geoserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def on_modified(self, path: str) -> None:

def resync(self) -> None:
# FIXME: this should be implemented in the eventual task addressing the resync mechanism.
raise NotImplementedError
LOGGER.debug("Event [resync] for handler [%s] is not implemented", self.name)

@staticmethod
def _is_permission_update_required(effective_permissions: List[JSON],
Expand Down
6 changes: 3 additions & 3 deletions cowbird/handlers/impl/magpie.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ def get_group_permissions_by_res_id(self, grp: str, res_id: int, effective: bool
return resp.json()

def user_created(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_created] for handler [%s] is not implemented", self.name)

def user_deleted(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_deleted] for handler [%s] is not implemented", self.name)

def permission_created(self, permission: Permission) -> None:
self.permissions_synch.create_permission(permission)
Expand All @@ -303,7 +303,7 @@ def permission_deleted(self, permission: Permission) -> None:

def resync(self) -> None:
# FIXME: this should be implemented in the eventual task addressing the resync mechanism.
raise NotImplementedError
LOGGER.debug("Event [resync] for handler [%s] is not implemented", self.name)

def create_permissions(self, permissions_data: List[PermissionConfigItemType]) -> None:
"""
Expand Down
14 changes: 9 additions & 5 deletions cowbird/handlers/impl/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from cowbird.handlers.handler import Handler
from cowbird.permissions_synchronizer import Permission
from cowbird.typedefs import SettingsType
from cowbird.utils import get_logger


LOGGER = get_logger(__name__)


class Nginx(Handler):
Expand All @@ -21,17 +25,17 @@ def __init__(self, settings: SettingsType, name: str, **kwargs: Any) -> None:
super(Nginx, self).__init__(settings, name, **kwargs)

def user_created(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_created] for handler [%s] is not implemented", self.name)

def user_deleted(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_deleted] for handler [%s] is not implemented", self.name)

def permission_created(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_created] for handler [%s] is not implemented", self.name)

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_deleted] for handler [%s] is not implemented", self.name)

def resync(self) -> None:
# FIXME: this should be implemented in the eventual task addressing the resync mechanism.:
raise NotImplementedError
LOGGER.debug("Event [resync] for handler [%s] is not implemented", self.name)
14 changes: 9 additions & 5 deletions cowbird/handlers/impl/thredds.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from cowbird.handlers.handler import Handler
from cowbird.permissions_synchronizer import Permission
from cowbird.typedefs import SettingsType
from cowbird.utils import get_logger


LOGGER = get_logger(__name__)


class Thredds(Handler):
Expand All @@ -21,17 +25,17 @@ def __init__(self, settings: SettingsType, name: str, **kwargs: Any) -> None:
super(Thredds, self).__init__(settings, name, **kwargs)

def user_created(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_created] for handler [%s] is not implemented", self.name)

def user_deleted(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.debug("Event [user_deleted] for handler [%s] is not implemented", self.name)

def permission_created(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_created] for handler [%s] is not implemented", self.name)

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.debug("Event [permission_deleted] for handler [%s] is not implemented", self.name)

def resync(self) -> None:
# FIXME: this should be implemented in the eventual task addressing the resync mechanism.
raise NotImplementedError
LOGGER.debug("Event [resync] for handler [%s] is not implemented", self.name)

0 comments on commit 5803793

Please sign in to comment.