ternya/process.py
def keystone_process(body, message):
    """
    This function deal with the keystone notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:
    """
    event_type = body['event_type']
    process = keystone_customer_process.get(event_type)
    if process is not None:
        process(body, message)
    else:
        matched = False
        process_wildcard = None
        for pattern in keystone_customer_process_wildcard.keys():
            if pattern.match(event_type):
                process_wildcard = keystone_customer_process_wildcard.get(pattern)
                matched = True
                break
        if matched:
            process_wildcard(body, message)
        else:
            default_process(body, message)
    message.ack()
def keystone_process(body, message):
    """
    This function deal with the keystone notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:
    """
    event_type = body['event_type']
    process = keystone_customer_process.get(event_type)
    if process is not None:
        process(body, message)
    else:
        matched = False
        process_wildcard = None
        for pattern in keystone_customer_process_wildcard.keys():
            if pattern.match(event_type):
                process_wildcard = keystone_customer_process_wildcard.get(pattern)
                matched = True
                break
        if matched:
            process_wildcard(body, message)
        else:
            default_process(body, message)
    message.ack()
def keystone_process ( body , message ) : event_type = body [ 'event_type' ] process = keystone_customer_process . get ( event_type ) if process is not None : process ( body , message ) else : matched = False process_wildcard = None for pattern in keystone_customer_process_wildcard . keys ( ) : if pattern . match ( event_type ) : process_wildcard = keystone_customer_process_wildcard . get ( pattern ) matched = True break if matched : process_wildcard ( body , message ) else : default_process ( body , message ) message . ack ( )
This function deal with the keystone notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:
This function deal with the keystone notification .