diff --git a/wis2box-management/wis2box/handler.py b/wis2box-management/wis2box/handler.py index a6adbc17..11f4bd77 100644 --- a/wis2box-management/wis2box/handler.py +++ b/wis2box-management/wis2box/handler.py @@ -59,6 +59,10 @@ def __init__(self, filepath: str, topic_hierarchy: str = None): th = self.filepath fuzzy = True + if '/metadata/' in th: + msg = 'Passing on handling metadata in workflow' + raise NotHandledError(msg) + try: self.topic_hierarchy, self.plugins = validate_and_load( th, self.filetype, fuzzy=fuzzy) @@ -130,3 +134,7 @@ def publish(self) -> bool: upsert_collection_item(index_name, geojson) return True + + +class NotHandledError(Exception): + pass diff --git a/wis2box-management/wis2box/pubsub/subscribe.py b/wis2box-management/wis2box/pubsub/subscribe.py index ac220388..a0b51443 100644 --- a/wis2box-management/wis2box/pubsub/subscribe.py +++ b/wis2box-management/wis2box/pubsub/subscribe.py @@ -31,7 +31,7 @@ from wis2box.api import setup_collection from wis2box.env import (BROKER_HOST, BROKER_PORT, BROKER_USERNAME, BROKER_PASSWORD, STORAGE_SOURCE, STORAGE_ARCHIVE) -from wis2box.handler import Handler +from wis2box.handler import Handler, NotHandledError from wis2box.plugin import load_plugin, PLUGINS from wis2box.pubsub.message import gcm @@ -47,6 +47,9 @@ def handle(filepath): for plugin in handler.plugins: for filepath in plugin.files(): LOGGER.info(f'Public filepath: {filepath}') + except NotHandledError as err: + msg = f'not handled error: {err}' + LOGGER.debug(msg) except ValueError as err: msg = f'handle() error: {err}' LOGGER.error(msg)