diff --git a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py index cc81f8e26..bf1fcf2cc 100644 --- a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py +++ b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py @@ -1,6 +1,5 @@ from abc import ABC, abstractmethod from enum import Enum, auto -from typing import Any from . import IslandEventSubscriber @@ -29,12 +28,12 @@ class IIslandEventQueue(ABC): pass @abstractmethod - def publish(self, topic: IslandEventTopic, event: Any = None): + def publish(self, topic: IslandEventTopic, **kwargs): """ Publishes an event topic with the given data :param topic: Event topic to publish - :param event: Event data to publish + :param **kwargs: Event data to publish """ pass diff --git a/monkey/monkey_island/cc/event_queue/pypubsub_island_event_queue.py b/monkey/monkey_island/cc/event_queue/pypubsub_island_event_queue.py index 3cf1399c9..8f7759072 100644 --- a/monkey/monkey_island/cc/event_queue/pypubsub_island_event_queue.py +++ b/monkey/monkey_island/cc/event_queue/pypubsub_island_event_queue.py @@ -1,5 +1,4 @@ import logging -from typing import Any from pubsub.core import Publisher @@ -18,11 +17,11 @@ class PyPubSubIslandEventQueue(IIslandEventQueue): topic_name = topic.name # needs to be a string for pypubsub self._pypubsub_publisher_wrapper.subscribe(topic_name, subscriber) - def publish(self, topic: IslandEventTopic, event: Any = None): + def publish(self, topic: IslandEventTopic, **kwargs): topic_name = topic.name # needs to be a string for pypubsub logger.debug(f"Publishing {topic_name} event") - if event is None: - self._pypubsub_publisher_wrapper.publish(topic_name) - else: - self._pypubsub_publisher_wrapper.publish(topic_name, event=event) + # if event is None: + # self._pypubsub_publisher_wrapper.publish(topic_name) + # else: + self._pypubsub_publisher_wrapper.publish(topic_name, **kwargs)