def mod_aggregate(low, chunks, running):
    '''
    The mod_aggregate function which looks up all rules in the available
    low chunks and merges them into a single rules ref in the present low data
    '''
    rules = []
    agg_enabled = [
            'append',
            'insert',
    ]
    if low.get('fun') not in agg_enabled:
        return low
    for chunk in chunks:
        tag = __utils__['state.gen_tag'](chunk)
        if tag in running:
            # Already ran the iptables state, skip aggregation
            continue
        if chunk.get('state') == 'iptables':
            if '__agg__' in chunk:
                continue
            # Check for the same function
            if chunk.get('fun') != low.get('fun'):
                continue

            if chunk not in rules:
                rules.append(chunk)
                chunk['__agg__'] = True

    if rules:
        if 'rules' in low:
            low['rules'].extend(rules)
        else:
            low['rules'] = rules
    return low
def mod_aggregate ( low , chunks , running ) : rules = [ ] agg_enabled = [ 'append' , 'insert' , ] if low . get ( 'fun' ) not in agg_enabled : return low for chunk in chunks : tag = __utils__ [ 'state.gen_tag' ] ( chunk ) if tag in running : continue if chunk . get ( 'state' ) == 'iptables' : if '__agg__' in chunk : continue if chunk . get ( 'fun' ) != low . get ( 'fun' ) : continue if chunk not in rules : rules . append ( chunk ) chunk [ '__agg__' ] = True if rules : if 'rules' in low : low [ 'rules' ] . extend ( rules ) else : low [ 'rules' ] = rules return low
The mod_aggregate function which looks up all rules in the available
    low chunks and merges them into a single rules ref in the present low data