Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!147Resolve "Notificatoins from Context are incomplete"
...@@ -77,8 +77,9 @@ def notify_event_policy_rule(messagebroker : MessageBroker, event_type : EventTy ...@@ -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}) notify_event(messagebroker, EventTopicEnum.POLICY_RULE, event_type, {'policyrule_id': policyrule_id})
def consume_events( 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: ) -> Iterator:
topic_names = [topic_enum.value for topic_enum in topic_enums]
for message in messagebroker.consume(topic_names, consume_timeout=consume_timeout): for message in messagebroker.consume(topic_names, consume_timeout=consume_timeout):
event_class = TOPIC_TO_EVENTCLASS.get(message.topic) event_class = TOPIC_TO_EVENTCLASS.get(message.topic)
if event_class is None: if event_class is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment