From feb286ea623a6e7ca3a347b91e1ea0f88de8e5a5 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Tue, 6 Feb 2024 14:53:51 -0500 Subject: [PATCH] Revert "add notification to refresh data mappings" This reverts commit 951f336d8d4913ab92325a2973be7c2d1188778d. --- wis2box-management/wis2box/api/__init__.py | 23 +------------------ wis2box-management/wis2box/topic_hierarchy.py | 1 - 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/wis2box-management/wis2box/api/__init__.py b/wis2box-management/wis2box/api/__init__.py index e656d75e..333edb63 100644 --- a/wis2box-management/wis2box/api/__init__.py +++ b/wis2box-management/wis2box/api/__init__.py @@ -22,28 +22,13 @@ import click import logging -from wis2box import cli_helpers from wis2box.api.backend import load_backend from wis2box.api.config import load_config -from wis2box.env import (BROKER_HOST, BROKER_USERNAME, BROKER_PASSWORD, - BROKER_PORT) -from wis2box.plugin import load_plugin, PLUGINS - +from wis2box import cli_helpers LOGGER = logging.getLogger(__name__) -def refresh_data_mappings(): - # load plugin for local broker - defs_local = { - 'codepath': PLUGINS['pubsub']['mqtt']['plugin'], - 'url': f'mqtt://{BROKER_USERNAME}:{BROKER_PASSWORD}@{BROKER_HOST}:{BROKER_PORT}', # noqa - 'client_type': 'dataset-manager' - } - local_broker = load_plugin('pubsub', defs_local) - local_broker.pub('wis2box/data_mappings/refresh', '{}', qos=0) - - def setup_collection(meta: dict = {}) -> bool: """ Add collection to api backend and configuration @@ -81,9 +66,6 @@ def setup_collection(meta: dict = {}) -> bool: LOGGER.error(msg) return False - LOGGER.debug('Refreshing data mappings') - refresh_data_mappings() - return True @@ -128,9 +110,6 @@ def remove_collection(collection_id: str, backend: bool = True, msg = f'discovery metadata {collection_id} not found' LOGGER.warning(msg) - LOGGER.debug('Refreshing data mappings') - refresh_data_mappings() - return True diff --git a/wis2box-management/wis2box/topic_hierarchy.py b/wis2box-management/wis2box/topic_hierarchy.py index ac6f2927..8fb1b5b0 100644 --- a/wis2box-management/wis2box/topic_hierarchy.py +++ b/wis2box-management/wis2box/topic_hierarchy.py @@ -86,7 +86,6 @@ def validate_and_load(topic_hierarchy: str, """ LOGGER.debug(f'Validating topic hierarchy: {topic_hierarchy}') - LOGGER.debug(f'Data mappings {data_mappings}') th = TopicHierarchy(topic_hierarchy) found = False