diff --git a/boswatch/router/router.py b/boswatch/router/router.py index 496cf38..d88def1 100644 --- a/boswatch/router/router.py +++ b/boswatch/router/router.py @@ -47,7 +47,7 @@ class Router: logging.debug("[%s] started", self._name) for routeObject in self._routeList: logging.debug("[%s] -> run route: %s", self._name, routeObject.name) - bwPacket_tmp = routeObject.callback._run(copy.deepcopy(bwPacket)) # copy bwPacket to prevent edit the original + bwPacket_tmp = routeObject.callback(copy.deepcopy(bwPacket)) # copy bwPacket to prevent edit the original if bwPacket_tmp is None: # returning None doesnt change the bwPacket continue diff --git a/boswatch/router/routerManager.py b/boswatch/router/routerManager.py index 2613238..a057872 100644 --- a/boswatch/router/routerManager.py +++ b/boswatch/router/routerManager.py @@ -77,12 +77,12 @@ class RouterManager: if routeType == "plugin": importedFile = importlib.import_module(routeType + "." + routeRes) loadedClass = importedFile.BoswatchPlugin(routeConfig) - routerDict_tmp[routerName].addRoute(Route(routeName, loadedClass)) + routerDict_tmp[routerName].addRoute(Route(routeName, loadedClass._run, loadedClass._getStatistics)) elif routeType == "module": importedFile = importlib.import_module(routeType + "." + routeRes) loadedClass = importedFile.BoswatchModule(routeConfig) - routerDict_tmp[routerName].addRoute(Route(routeName, loadedClass)) + routerDict_tmp[routerName].addRoute(Route(routeName, loadedClass._run, loadedClass._getStatistics)) elif routeType == "router": routerDict_tmp[routerName].addRoute(Route(routeName, routerDict_tmp[routeName].runRouter))