

def to_event(self, notification_body, condenser=None):
    if (condenser is None):
        condenser = DictionaryCondenser()
    event_type = notification_body['event_type']
    message_id = notification_body['message_id']
    edef = None
    for d in self.definitions:
        if d.match_type(event_type):
            edef = d
            break
    if (edef is None):
        msg = ('Dropping Notification %(type)s (uuid:%(msgid)s)' % dict(type=event_type, msgid=message_id))
        if self.catchall:
            logger.error(msg)
        else:
            logger.debug(msg)
        return None
    return edef.to_event(notification_body, condenser)

dataset/ETHPy150Open openstack/stacktach-stackdistiller/stackdistiller/distiller.py Distiller.to_event/original