Univention Bugzilla – Bug 56146
Wrong policies written back with Simple UDM API version 3
Last modified: 2023-06-21 09:24:42 CEST
Version 3 of Simple UDM API introduced policies in UDM REST API like representations. The decoding part works fine, but encoding it back when saving is broken and stores the UDM policy module names instead of the DNs. Another problem is that the ListOfListOflTextToDictPropertyEncoder returns a list instead of a dict in case the values provided are empty. It should always return a dict. +++ This bug was initially created as a clone of Bug #50167 +++
univention-directory-manager-modules (15.0.23-1) c86b8405e700 | fix(simple-udm): fix saving policies in version >= 3 0231ce7e64b2 | fix(simple-udm): ListOfListOflTextToDictPropertyEncoder should always return a dict
univention-directory-manager-modules (15.0.24-1) acd97b360e5a | Bug #56146: fix settting empty policy fixed: https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-4/job/AutotestJoin/SambaVersion=no-samba,Systemrolle=master-part-II/ws/test/ucs-test.log Traceback (most recent call last): File "/usr/share/ucs-test/86_selenium/17_self_service_registration.py", line 43, in activate_self_registration yield ucr File "/usr/lib/python3/dist-packages/univention/testing/ucr.py", line 121, in __exit__ self.revert_to_original_registry() File "/usr/lib/python3/dist-packages/univention/testing/ucr.py", line 101, in revert_to_original_registry self.handler_unset(list(keylist), {option: True}) File "/usr/lib/python3/dist-packages/univention/testing/ucr.py", line 74, in handler_unset return univention.config_registry.handler_unset(*args) File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 232, in handler_unset _run_changed(ucr, changed, 'W: %s is still set in scope "%s"') File "/usr/lib/python3/dist-packages/univention/config_registry/frontend.py", line 275, in _run_changed handlers(list(visible), (ucr, visible)) File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 1101, in __call__ handler(arg) File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 636, in __call__ run_module(self.module, 'handler', ucr, changed) File "/usr/lib/python3/dist-packages/univention/config_registry/handler.py", line 220, in run_module f(ucr, changes) File "/etc/univention/templates/modules/self-service-links.py", line 59, in handler obj.save() File "/usr/lib/python3/dist-packages/univention/udm/modules/generic.py", line 176, in save self._copy_to_udm_obj() File "/usr/lib/python3/dist-packages/univention/udm/modules/generic.py", line 343, in _copy_to_udm_obj self._orig_udm_object.policies = functools.reduce(lambda x, y: x + y, self.policies.values()) TypeError: reduce() of empty sequence with no initial value
OK: Self service joinscript works again with version(3) OK: Code review
UCS 5.0-4 has been released: https://docs.software-univention.de/release-notes/5.0-4/en/ If this error occurs again, please use the 'Clone This Bug' option.