Bug 37081 - udm syntax checkLdap is always executed, even if the attribute was not changed
udm syntax checkLdap is always executed, even if the attribute was not changed
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-27 11:30 CET by Felix Botner
Modified: 2017-08-02 14:34 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?: Yes
School Customer affected?:
ISV affected?:
Ticket number:
Bug group (optional): External feedback, Large environments, UCS Performance
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (916 bytes, patch)
2016-09-07 15:02 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2014-11-27 11:30:02 CET
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
Comment 1 Florian Best univentionstaff 2016-09-07 15:02:43 CEST
Created attachment 7986 [details]
patch
Comment 2 Florian Best univentionstaff 2017-06-28 14:52:46 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 3 Florian Best univentionstaff 2017-07-28 15:49:46 CEST
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
Comment 4 Johannes Keiser univentionstaff 2017-07-31 12:42:50 CEST
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
Comment 5 Arvid Requate univentionstaff 2017-08-02 14:34:10 CEST
<http://errata.software-univention.de/ucs/4.2/121.html>