Bug 51184 - Traceback in UDM's DN encoders if list is empty
Traceback in UDM's DN encoders if list is empty
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-4-errata
Assigned To: Dirk Wiesenthal
Florian Best
:
Depends on:
Blocks: 51157
  Show dependency treegraph
 
Reported: 2020-04-29 10:52 CEST by Dirk Wiesenthal
Modified: 2020-05-06 14:40 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2020-04-29 10:52:34 CEST
from univention.udm import *
udm = UDM.admin().version(2)
dn = ...
u = udm.get('users/user').get(dn)
u.props.secretary.objs
 
Results in
Traceback (most recent call last):
  File "t.py", line 4, in <module>
    u.props.secretary.objs
AttributeError: 'list' object has no attribute 'objs'


although the "secretary" property is defined as dn_list_property_encoder_for('users/user')


The problem occurs if there is no secretary information in LDAP, thus the value is None during decoding.
Comment 1 Dirk Wiesenthal univentionstaff 2020-05-03 16:13:50 CEST
Fixed in
  univention-directory-manager-modules (14.0.15-4)
Comment 2 Dirk Wiesenthal univentionstaff 2020-05-04 15:58:08 CEST
Added a test
  59_udm/60_udm_api_encoders.py
Comment 3 Florian Best univentionstaff 2020-05-05 14:17:40 CEST
OK: fix
OK: YAML
Comment 4 Erik Damrose univentionstaff 2020-05-06 14:40:03 CEST
<http://errata.software-univention.de/ucs/4.4/589.html>