def _process_entries(l, entries):
 old = OrderedDict()
 new = OrderedDict()
 for entries_dict in entries:
  for (dn, directives_seq) in six.iteritems(entries_dict):
   olde = new.get(dn, None)
   if (olde is None):
    results = __salt__['ldap3.search'](l, dn, 'base')
    if (len(results) == 1):
     attrs = results[dn]
     olde = dict(((attr, set(attrs[attr])) for attr in attrs if len(attrs[attr])))
    else:
     assert (len(results) == 0)
     olde = {}
    old[dn] = olde
   newe = copy.deepcopy(olde)
   new[dn] = newe
   entry_status = {'delete_others': False, 'mentioned_attributes': set()}
   for directives in directives_seq:
    _update_entry(newe, entry_status, directives)
   if entry_status['delete_others']:
    to_delete = set()
    for attr in newe:
     if (attr not in entry_status['mentioned_attributes']):
      to_delete.add(attr)
    for attr in to_delete:
     del newe[attr]
 return (old, new)

def _process_entries ( l , entries ) : old = OrderedDict ( ) new = OrderedDict ( ) for entries_dict in entries : for ( dn , directives_seq ) in six . iteritems ( entries_dict ) : olde = new . get ( dn , None ) if ( olde is None ) : results = __salt__ [ 'ldap3.search' ] ( l , dn , 'base' ) if ( len ( results ) == 1 ) : attrs = results [ dn ] olde = dict ( ( ( attr , set ( attrs [ attr ] ) ) for attr in attrs if len ( attrs [ attr ] ) ) ) else : assert ( len ( results ) == 0 ) olde = { } old [ dn ] = olde newe = copy . deepcopy ( olde ) new [ dn ] = newe entry_status = { 'delete_others' : False , 'mentioned_attributes' : set ( ) } for directives in directives_seq : _update_entry ( newe , entry_status , directives ) if entry_status [ 'delete_others' ] : to_delete = set ( ) for attr in newe : if ( attr not in entry_status [ 'mentioned_attributes' ] ) : to_delete . add ( attr ) for attr in to_delete : del newe [ attr ] return ( old , new )
helper for managed() to process entries and return before/after views collect the current database state and update it according to the data in :py:func:manageds entries parameter .