Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not treat handlers actions that have not been implemented as a dispatch failure #78

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Changes
* Pin ``watchdog>=5`` to employ typing fixes.
* Pin ``requests>=2.32.3`` to fix security vulnerability.
* Pin ``setuptools>=70.0.0`` to fix security vulnerability.
* Do not treat handlers actions that have not been implemented as a dispatch failure.

`2.4.0 <https://github.com/Ouranosinc/cowbird/tree/2.4.0>`_ (2024-07-09)
------------------------------------------------------------------------------------
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.info("Event [permission_created] for handler [%s] is not implemented", self.name)

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.info("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.warning("Event [resync] for handler [%s] is not implemented but should be in the future", 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.warning("Event [resync] for handler [%s] is not implemented but should be in the future", self.name)

@staticmethod
def _is_permission_update_required(effective_permissions: List[JSON],
Expand Down
8 changes: 5 additions & 3 deletions cowbird/handlers/impl/magpie.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,12 @@ 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.warning("Event [user_created] for handler [%s] is not implemented since Magpie "
"has already created the user.", self.name)

def user_deleted(self, user_name: str) -> None:
raise NotImplementedError
LOGGER.warning("Event [user_deleted] for handler [%s] is not implemented since Magpie "
"has already deleted the user.", self.name)

def permission_created(self, permission: Permission) -> None:
self.permissions_synch.create_permission(permission)
Expand All @@ -303,7 +305,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.warning("Event [resync] for handler [%s] is not implemented but should be in the future", 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.info("Event [user_created] for handler [%s] is not implemented", self.name)

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

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

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.info("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.warning("Event [resync] for handler [%s] is not implemented but should be in the future", 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.info("Event [user_created] for handler [%s] is not implemented", self.name)

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

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

def permission_deleted(self, permission: Permission) -> None:
raise NotImplementedError
LOGGER.info("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.warning("Event [resync] for handler [%s] is not implemented but should be in the future", self.name)
Loading