Univention Bugzilla – Bug 54561
u-group-membership-cache returns None instead of empty list
Last modified: 2022-10-11 16:30:19 CEST
univention-group-membership-cache returns unexpected values if a cache entry has no values. A library using the cache expected that an empty list is returned if an entry has no value - the usual use case is to iterate over the returned values. I would also expect that an empty list is returned. I would also expect that cache.get() returns [], not None. Although one could argue that a user of the cache has to check if the return value is None. Traceback from customer environment, with installed office365 app. "/usr/lib/pymodules/python2.7/univention/office365/udm_helper.py", line 146, in group_in_azure alias_users = set(map(unicode.lower, univentionOffice365ADConnectionAlias.get(self.adconnection_alias))) TypeError: argument 2 to map() must support iteration The issue exists in UCS 4 + 5
The replication does not work, if the group sysnc is activated and this error occurs. I would like to increase the pain.
Package: univention-group-membership-cache Version: 1.0.0-11A~4.4.0.202203211826 Branch: ucs_4.4-0 Scope: errata4.4-8 1ccfc420e7 Bug #54561: advisory 8ec42b09ce Bug #54561: Return an empty list instead of None if key doesn't exist in cache In single value caches, None is still returned, but in multi-value cases an empty list is returned. This fixes the observed error in the microsoft365 connector.
Tests: OK YAML: OK Manual tests: OK, multi value and single value work as one would expect VERIFIED
<https://errata.software-univention.de/#/?erratum=4.4x1207>