ternya/process.py
def cinder_process(body, message):
    """
    This function deal with the cinder 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 = cinder_customer_process.get(event_type)
    if process is not None:
        process(body, message)
    else:
        matched = False
        process_wildcard = None
        for pattern in cinder_customer_process_wildcard.keys():
            if pattern.match(event_type):
                process_wildcard = cinder_customer_process_wildcard.get(pattern)
                matched = True
                break
        if matched:
            process_wildcard(body, message)
        else:
            default_process(body, message)
    message.ack()
def cinder_process(body, message):
    event_type = body['event_type']
    process = cinder_customer_process.get(event_type)
    if process is not None:
        process(body, message)
    else:
        matched = False
        process_wildcard = None
        for pattern in cinder_customer_process_wildcard.keys():
            if pattern.match(event_type):
                process_wildcard = cinder_customer_process_wildcard.get(pattern)
                matched = True
                break
        if matched:
            process_wildcard(body, message)
        else:
            default_process(body, message)
    message.ack()
def cinder_process ( body , message ) : event_type = body [ 'event_type' ] process = cinder_customer_process . get ( event_type ) if process is not None : process ( body , message ) else : matched = False process_wildcard = None for pattern in cinder_customer_process_wildcard . keys ( ) : if pattern . match ( event_type ) : process_wildcard = cinder_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 cinder 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 cinder notification .