*** __init__.py 2017-10-10 11:37:28.718544259 +0200 --- __init__.py.bak 2017-10-06 18:06:00.000000000 +0200 *************** *** 735,785 **** def _post_unmap(self, info, values): """This method can be overwritten to define special un-map methods that can not be done with the default mapping API""" - univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap called with info=[%s] values=[%s]' % (str(info),str(values))) - # Allow the fromLDAP() method of the syntax class to convert - # a raw LDAP value into UDM-specific representation - for field in info: - try: - s = self.descriptions[field].syntax - univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap: field=%s syntax=%s' % (field,str(s))) - if callable(s.fromLDAP): - univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_unmap: This syntax has a fromLDAP() method') - if isinstance(info[field],list): - newval = [] - for val in info[field]: - newval.append(s.fromLDAP(val)) - info[field] = newval - else: - info[field] = s.fromLDAP(info[field]) - except AttributeError, e: - pass - except Exception, e: - univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'modules/__init__.py _post_unmap: Exception "%s" "%s"' % (e.__class__.__name__,e.message)) - return info def _post_map(self, modlist, diff): """This method can be overwritten to define special map methods that can not be done with the default mapping API""" ! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map called with modlist=[%s] diff=[%s]' % (str(modlist),str(diff))) ! ml = [] ! for tuple in modlist: ! has_callback = False ! try: ! s = self.descriptions[tuple[0]].syntax ! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map: field=%s syntax=%s' % (tuple[0],str(s))) ! if callable(s.toLDAP): ! univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'modules/__init__.py _post_map: This syntax has a toLDAP() method') ! has_callback = True ! except AttributeError, e: ! pass ! except Exception, e: ! univention.debug.debug(univention.debug.ADMIN, univention.debug.WARN, 'modules/__init__.py _post_map: Exception "%s" "%s"' % (e.__class__.__name__,e.message)) ! if has_callback: ! newval = s.toLDAP(tuple[2]) ! tuple = (tuple[0], tuple[1], newval) ! ml.append(tuple) ! return ml def _ldap_modlist(self): self.exceptions = [] --- 735,746 ---- def _post_unmap(self, info, values): """This method can be overwritten to define special un-map methods that can not be done with the default mapping API""" return info def _post_map(self, modlist, diff): """This method can be overwritten to define special map methods that can not be done with the default mapping API""" ! return modlist def _ldap_modlist(self): self.exceptions = []