Univention Bugzilla – Bug 53459
self-service-acl.py not Python 2 compatible
Last modified: 2021-08-16 15:37:46 CEST
Changing the UCR variables of the self-service in a Python 2 process raises an exception: Traceback (most recent call last): File "115_modify_userattributes_and_ldap_acl.py", line 26, in <module> handler_set(["umc/self-service/profiledata/enabled=true"]) File "/usr/lib/python2.7/dist-packages/univention/config_registry/frontend.py", line 175, in handler_set _run_changed(ucr, changed, "" if quiet else 'W: %s is overridden by scope "%s"') File "/usr/lib/python2.7/dist-packages/univention/config_registry/frontend.py", line 241, in _run_changed handlers(list(visible), (ucr, visible)) File "/usr/lib/python2.7/dist-packages/univention/config_registry/handler.py", line 1087, in __call__ handler(arg) File "/usr/lib/python2.7/dist-packages/univention/config_registry/handler.py", line 635, in __call__ run_module(self.module, 'generate', ucr, changed) File "/usr/lib/python2.7/dist-packages/univention/config_registry/handler.py", line 222, in run_module arg2meth[arg](module)(ucr, changes) File "/etc/univention/templates/modules/self-service-acl.py", line 61, in handler params['ldap_attributes'] = ','.join(map(str.strip, params['ldap_attributes'].split(','))) TypeError: descriptor 'strip' requires a 'str' object but received a 'unicode' This affects test cases for UCS@school 5.0.
Replaces str.strip(string) with string.strip(). univention-self-service.yaml 47c93e2d2e63 | Bug #53459: fix Python 2 compatible of UCR module self-service-acl.py univention-self-service (5.0.1-14) 47c93e2d2e63 | Bug #53459: fix Python 2 compatible of UCR module self-service-acl.py
OK: python2 compatibility OK: yaml (f7105f1093 Bug #53459: yaml) -> verified
<https://errata.software-univention.de/#/?erratum=5.0x24>