Univention Bugzilla – Bug 41235
Remove atomic parameter from univention.uldap.access.modify()
Last modified: 2018-04-13 13:28:44 CEST
The function parameter 'atomic' is broken (and nowhere used): univention.uldap.access.modify(dn, changes, atomic=0) Trying to use this either raises a exception: >>> lo.modify('cn=foo', [('foo', '1', '2')], atomic=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fbest/svn/dev/branches/ucs/base/univention-python/modules/uldap.py", line 476, in modify ml.append((ldap.MOD_DELETE, key, val)) UnboundLocalError: local variable 'val' referenced before assignment Or even worse, it changes the modlist to: >>> lo.modify('cn=foo', [('foo', None, '2'), ('bar', '3', '4')], atomic=True) → [(0, 'foo', '2'), (1, 'bar', '2'), (0, 'bar', '2')] It should simply be removed. diff --git a/base/univention-python/modules/uldap.py b/base/univention-python/modules/uldap.py index 580feb2..9258df5 100644 --- a/base/univention-python/modules/uldap.py +++ b/base/univention-python/modules/uldap.py @@ -460 +460 @@ def add(self, dn, al): - def modify(self, dn, changes, atomic=0): + def modify(self, dn, changes): @@ -475,4 +474,0 @@ def modify(self, dn, changes, atomic=0): - if atomic: - ml.append((ldap.MOD_DELETE, key, val)) - ml.append((ldap.MOD_ADD, key, val)) - continue
removed during Bug #40041 *** This bug has been marked as a duplicate of bug 40041 ***