Univention Bugzilla – Bug 51327
management/univention-self-service: migrate to python3
Last modified: 2022-02-23 16:29:28 CET
The UMC module of management/univention-self-service has to be python3-compatible.
An API change of the UDM object property type from str → unicode causes this traceback: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 102, in _decorator return func(self, request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 179, in _decorated return func(self, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 321, in _response result = _multi_response(self, request) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response return function(self, request) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 443, in _response return list(function(self, iterator, *nones)) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 289, in _fake_func yield function(self, *args) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 289, in get_contact if self.is_blacklisted(username, 'passwordreset'): File "/usr/lib/python2.7/dist-packages/univention/management/console/ldap.py", line 152, in _decorated result = func(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/passwordreset/__init__.py", line 1078, in is_blacklisted gr_names = map(str.lower, self.dns_to_groupname(groups_dns)) TypeError: descriptor 'lower' requires a 'str' object but received a 'unicode'
(In reply to Florian Best from comment #1) > An API change of the UDM object property type from str → unicode causes this > traceback: This has already been fixed: univention-self-service (5.0.0-3) b8698259b9d1 | Bug #51327: conform to UDM API change The listener module has already been migrated to Python 3: univention-self-service (5.0.0-5) f53b2cd149f1 | Bug #51327: migrate self service listener to Python 3 Leftovers are: ./delete_deregistered_accounts.py ./univention-self-service-invitation ./univention-self-service-request-count ./unittests/test_verify_user.py ./unittests/test_selfservice-blackwhitelists.py ./unittests/conftest.py ./conffiles/self-service-acl.py ./umc/python/passwordreset/tokendb.py ./umc/python/passwordreset/__init__.py ./umc/python/passwordreset/send_plugin.py ./umc/python/passwordreset/sending/send_email.py ./umc/python/passwordreset/sending/send_with_external.py ./umc/python/passwordreset/sending/verify_email.py ./umc/python/passwordreset/sending/__init__.py ./umc/python/passwordreset/sending/send_sms.py
Please migrate the leftovers to Python 3. Especially start with the UMC module and test your changes manually. General notes about Python 3 migration are here: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration To execute the module with Python 3 the steps described in has to be done: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration#UMC
We migrated the Univention-Self-Service and the corresponding Unittests to Python3, while staying Python2 compatible. The package univention-self-service has been migrated to Python 3. The UMC module will still be executed via Python 2 until UCS 5.0-2 due to possible custom plugins for sending the password recovery tokens. Customers need to provide their custom plugins for Python 3 until then. univention-unittests (2.0.1-3) 6d8003511cfb | Bug #51327: migrate self-service unittests to Python 3 a01141fa7587 | Bug #51327: migrate self-service to Python 3 univention-self-service (5.0.1-18) 6d8003511cfb | Bug #51327: migrate self-service unittests to Python 3 a01141fa7587 | Bug #51327: migrate self-service to Python 3
univention-self-service (5.0.1-18) 887c084829de | fixup! Bug #51327: migrate self-service to Python 3
OK: Python 3 migration of self-service UMC module OK: Python 3 migration of scripts OK: unittests migration OK: univention-unittests adjustments OK: ucs-test OK: reverting of executing self-service with Python 3
<https://errata.software-univention.de/#/?erratum=5.0x232>