Commit 907df502 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- Corrected signature of method consume_events
- Corrected topic name parsing of method consume_events
parent 633defb0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -77,8 +77,9 @@ def notify_event_policy_rule(messagebroker : MessageBroker, event_type : EventTy
    notify_event(messagebroker, EventTopicEnum.POLICY_RULE, event_type, {'policyrule_id': policyrule_id})

def consume_events(
    messagebroker : MessageBroker, topic_names : Set[str], consume_timeout : float = CONSUME_TIMEOUT
    messagebroker : MessageBroker, topic_enums : Set[EventTopicEnum], consume_timeout : float = CONSUME_TIMEOUT
) -> Iterator:
    topic_names = [topic_enum.value for topic_enum in topic_enums]
    for message in messagebroker.consume(topic_names, consume_timeout=consume_timeout):
        event_class = TOPIC_TO_EVENTCLASS.get(message.topic)
        if event_class is None: