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 = salt.utils.gen_state_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

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 = salt . utils . gen_state_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 packages in the available low chunks and merges them into a single pkgs ref in the present low data .