Bug 53459 - self-service-acl.py not Python 2 compatible
self-service-acl.py not Python 2 compatible
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Self Service
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks: 52578
  Show dependency treegraph
 
Reported: 2021-06-17 09:07 CEST by Florian Best
Modified: 2021-08-16 15:37 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-06-17 09:07:51 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.
Comment 1 Florian Best univentionstaff 2021-06-17 10:36:30 CEST
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
Comment 2 Johannes Keiser univentionstaff 2021-06-23 08:55:57 CEST
OK: python2 compatibility
OK: yaml (f7105f1093 Bug #53459: yaml)
-> verified
Comment 3 Erik Damrose univentionstaff 2021-06-23 15:55:51 CEST
<https://errata.software-univention.de/#/?erratum=5.0x24>