Univention Bugzilla – Bug 47971
UDM modules simpleLdap.items() has side effect
Last modified: 2021-04-14 10:37:23 CEST
When iterating over the properties of a UDM object, they are modified. simpleLdap.items() uses simpleLdap.__getitem__(), which changes the value to the default if it is unset. The interface of simpleLdap mimics that of dict.items(), but items() modifying data is unexpected. Fix could be: def items(self): - return [(key, self[key]) for key in self.keys() if self.has_property(key)] + return [(key, self.get(key)) for key in self.keys() if self.has_property(key)]
I guess iter{items, keys, values}() should also be provided, to allow iteration without data duplication.