Univention Bugzilla – Bug 37081
udm syntax checkLdap is always executed, even if the attribute was not changed
Last modified: 2017-08-02 14:34:10 CEST
If you have a univention.admin.syntax.UDM_Attribute syntax class with the checkLdap class method (to check for proper value if the api is used, not the UMC) than this method "checkLdap" is always executed if the objects is changed (not only if the attribute with this syntax is changed). # add debug output to checkLdap() method in emailAddressValidDomain class in # (print 'checking ldap') syntax.py -> vi /usr/share/pyshared/univention/admin/syntax.py # create python UDM script ... modules.update() users = modules.get('users/user') modules.init(lo, position, users) user = users.lookup(co, lo, 'uid=Administrator') user = user[0] user.open() user.modify() # no modification # run script -> python checking ldap checking ldap
Created attachment 7986 [details] patch
There is a Customer ID set so I set the flag "Enterprise Customer affected".
The only syntax class in UCS using checkLdap this is emailAddressValidDomain. It's used by the following modules users/user.py groups/group mail/folder.py mail/lists This increased performance when modifying such user objects. univention-directory-manager-modules (12.0.18-6): r81532 | Bug #37081 only call checkLdap if the property changed univention-directory-manager-modules.yaml: r81532 | Bug #37081 only call checkLdap if the property changed
OK # add debug output to checkLdap() method in emailAddressValidDomain class in # (print 'checking ldap') syntax.py -> vi /usr/share/pyshared/univention/admin/syntax.py # create python UDM script ... modules.update() users = modules.get('users/user') modules.init(lo, position, users) user = users.lookup(co, lo, 'uid=Administrator') user = user[0] user.open() user.modify() # no modification -> no output user['mailPrimaryAddress'] = 'foo@mydomain.intranet' user.modify() -> prints 'checking ldap' OK users/user, groups/group, mail/folder, mail/lists add/modify/delete YAML: OK -> verified
<http://errata.software-univention.de/ucs/4.2/121.html>