Commit b6e6d29f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- Corrected warning messages in events from Context component
parent 162f741d
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -102,21 +102,29 @@ def consume_events(
        #    LOGGER.warning(MSG.format(str(message.topic)))
        #    continue
        data = json.loads(message.content)
        if 'context_id' in data and EventTopicEnum.CONTEXT in topic_enums:
        if 'context_id' in data:
            if EventTopicEnum.CONTEXT not in topic_enums: continue
            yield ContextEvent(**data)
        elif 'topology_id' in data and EventTopicEnum.TOPOLOGY in topic_enums:
        elif 'topology_id' in data:
            if EventTopicEnum.TOPOLOGY not in topic_enums: continue
            yield TopologyEvent(**data)
        elif 'device_id' in data and EventTopicEnum.DEVICE in topic_enums:
        elif 'device_id' in data:
            if EventTopicEnum.DEVICE not in topic_enums: continue
            yield DeviceEvent(**data)
        elif 'opticalconfig_id' in data and EventTopicEnum.OPTICALCONFIG in topic_enums:
        elif 'opticalconfig_id' in data:
            if EventTopicEnum.OPTICALCONFIG not in topic_enums: continue
            yield DeviceEvent(**data)
        elif 'link_id' in data and EventTopicEnum.LINK in topic_enums:
        elif 'link_id' in data:
            if EventTopicEnum.LINK not in topic_enums: continue
            yield LinkEvent(**data)
        elif 'service_id' in data and EventTopicEnum.SERVICE in topic_enums:
        elif 'service_id' in data:
            if EventTopicEnum.SERVICE not in topic_enums: continue
            yield ServiceEvent(**data)
        elif 'slice_id' in data and EventTopicEnum.SLICE in topic_enums:
        elif 'slice_id' in data:
            if EventTopicEnum.SLICE not in topic_enums: continue
            yield SliceEvent(**data)
        elif 'connection_id' in data and EventTopicEnum.CONNECTION in topic_enums:
        elif 'connection_id' in data:
            if EventTopicEnum.CONNECTION not in topic_enums: continue
            yield ConnectionEvent(**data)
        else:
            MSG = 'Unable to identify EventClass for Message({:s}). Ignoring...'