Bug 52658 - Migrate UDM components of UCS@school to Python 3
Migrate UDM components of UCS@school to Python 3
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9-errata
Assigned To: Florian Best
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-01-14 16:29 CET by Florian Best
Modified: 2021-07-01 12:08 CEST (History)
2 users (show)

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-01-14 16:29:59 CET
The UDM modules/hooks/syntaces of UCS@school need to be Python 3 compatible.

ucs-school-import/modules/univention/admin/hooks.d/schoolOU.py
ucs-school-import/modules/univention/admin/hooks.d/schoolAdminGroup.py
ucs-school-import/udm_hook/ucsschool_user_options.py
ucs-school-import/udm_hook/ucsschool_purge_timestamp.py
ucs-school-import/udm_hook/ucsschool_role_computers.py
ucs-school-import/syntax/syntax.ucs-school-import.py
Comment 1 Florian Best univentionstaff 2021-01-18 14:33:10 CET
The list was missing:

ucs-school-umc-helpdesk/modules/univention/admin/handlers/settings/console_helpdesk.py
Comment 3 Florian Best univentionstaff 2021-06-02 00:24:57 CEST
ucs-school-import.yaml
88c93d17e76c | Bug #52658: migrate UDM hooks to be python3 compatible

ucs-school-import (17.0.61)
88c93d17e76c | Bug #52658: migrate UDM hooks to be python3 compatible

ucs-school-umc-helpdesk.yaml
1e82b0b6e6af | Bug #52658: migrate settings/console_helpdesk to Python 3

ucs-school-umc-helpdesk (15.0.0-4)
1e82b0b6e6af | Bug #52658: migrate settings/console_helpdesk to Python 3
Comment 4 Daniel Tröder univentionstaff 2021-06-03 00:05:31 CEST
Before commiting to the UCS@school repository (in all branches), please use the pre-commit hooks.
For installation instructions see: https://pre-commit.com/

Basically that's:
$ curl https://pre-commit.com/install-local.py | python -
$ cd git/ucsschool
$ pre-commit install --install-hooks

Then the provided Makefile can be used to run the formatters and linters without invoking "git commit" and without additional virtualenvs:

$ make             # see available options

$ make lint        #  This checks python files modified by you.
$ make lint-all    #  This checks all python files in the repository
$ make format      #  This formats all changed python files.
$ make format-all  #  This formats all python files in the repository
Comment 5 Florian Best univentionstaff 2021-06-03 01:06:47 CEST
Fixed the pre-commit (black, isort) issues:

ucs-school-umc-helpdesk (15.0.0-5)
df383bc46ab2 | fixup! Bug #52658: migrate settings/console_helpdesk to Python 3

ucs-school-import (17.0.63)
bded3c306496 | fixup! Bug #52658: migrate UDM hooks to be python3 compatible
Comment 6 Daniel Tröder univentionstaff 2021-06-03 11:27:11 CEST
OK: code review
OK: Debian package updates
OK: manual tests of UDM hooks and modules

Reopen: The UMC files of package ucs-school-umc-helpdesk are missing and thus the UMC module does not work anymore.
Comment 7 Florian Best univentionstaff 2021-06-03 11:59:25 CEST
(In reply to Daniel Tröder from comment #6)
> Reopen: The UMC files of package ucs-school-umc-helpdesk are missing and
> thus the UMC module does not work anymore.
Oh yes, dh-umc-module-install was missing.

Fixed in:
ucs-school-umc-helpdesk (15.0.0-5)
f7247cb5888c | fixup! Bug #52589: migrate ucs-school-umc-helpdesk to dh_python
2bff5f2a5192 | fixup! Bug #52589: migrate ucs-school-umc-helpdesk to dh_python
13e49f6d748f | fixup! Bug #52589: migrate ucs-school-umc-helpdesk to dh_python
Comment 8 Daniel Tröder univentionstaff 2021-06-03 13:10:32 CEST
OK: Helpdesk UMC module works as expected.
Comment 9 Florian Best univentionstaff 2021-06-07 12:19:35 CEST
I had errors in the hook schoolOU.py:

* None should be used in the modlist instead of [b''] to remove a value.
* Since we decode object classes we don't need OBJECTCLASS_SCHOOLOU to be bytestring.                                                                             
* Since container/ou provides modules options since 2016 we don't need hook_open() anymore.  

fixed in:
ucs-school-import (17.0.66)
0d4582b79d08 | fixup! Bug #52658: migrate UDM hooks to be python3 compatible

Package: ucs-school-import
Version: 17.0.66A~4.4.0.202106071217
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 10 Daniel Tröder univentionstaff 2021-06-14 10:36:52 CEST
OK: fix code review
OK: manual test
OK: Jenkins tests
OK: package updates
Comment 11 Tobias Wenzel univentionstaff 2021-07-01 12:08:18 CEST
Errata updates for UCS@school 4.4 v9 have been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html

If this error occurs again, please clone this bug.