Bug 52614 - Migrate ucs-school-umc-distribution to Python 3
Migrate ucs-school-umc-distribution to Python 3
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v1
Assigned To: Florian Best
Christian Castens
: interim-5
Depends on:
Blocks: 52578
  Show dependency treegraph
 
Reported: 2021-01-12 15:23 CET by Florian Best
Modified: 2021-11-29 17:20 CET (History)
1 user (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-12 15:23:22 CET
The package ucs-school-umc-distribution needs to be migrated to Python 3.

See: https://hutten.knut.univention.de/mediawiki/index.php/Python_3_Migration
Comment 2 Florian Best univentionstaff 2021-06-24 19:04:11 CEST
We should also replace ValueError with UMC_Error to suppress the traceback and show a regular error message:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 344, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 247, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/schoolexam/__init__.py", line 492, in add
    self._save_exam(request)
  File "/usr/lib/python3/dist-packages/ucsschool/lib/school_umc_ldap_connection.py", line 155, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/schoolexam/__init__.py", line 406, in _save_exam
    project.validate()
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/distribution/util.py", line 379, in validate
    raise ValueError(_("The given project directory name must be non-empty."))
ValueError: Das angegebene Projektverzeichnis darf nicht leer sein.
Comment 3 Florian Best univentionstaff 2021-07-02 14:50:43 CEST
Migrated the module and the script to Python 3:

ucs-school-umc-distribution (18.0.2)
bf08232e3cd6 | Bug #52614: migrate ucs-school-umc-distribution to Python 3
Comment 4 Florian Best univentionstaff 2021-07-02 14:55:15 CEST
(In reply to Florian Best from comment #2)
> We should also replace ValueError with UMC_Error to suppress the traceback
> and show a regular error message:
> 
> Traceback (most recent call last):
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/base.py", line
> 344, in __error_handling
>     six.reraise(etype, exc, etraceback)
>   File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
>     raise value
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/base.py", line
> 247, in execute
>     function.__func__(self, request, *args, **kwargs)
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/modules/
> decorators.py", line 181, in _response
>     return function(self, request)
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/modules/
> schoolexam/__init__.py", line 492, in add
>     self._save_exam(request)
>   File
> "/usr/lib/python3/dist-packages/ucsschool/lib/school_umc_ldap_connection.py",
> line 155, in wrapper_func
>     return func(*args, **kwargs)
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/modules/
> schoolexam/__init__.py", line 406, in _save_exam
>     project.validate()
>   File
> "/usr/lib/python3/dist-packages/univention/management/console/modules/
> distribution/util.py", line 379, in validate
>     raise ValueError(_("The given project directory name must be
> non-empty."))
> ValueError: Das angegebene Projektverzeichnis darf nicht leer sein.

Fixed in:

ucs-school-umc-exam (10.0.1)
3fc8f2dd8b59 | Bug #52614: improove error handling

ucs-school-umc-distribution (18.0.2)
3fc8f2dd8b59 | Bug #52614: improove error handling
Comment 5 Christian Castens univentionstaff 2021-08-31 10:12:30 CEST
QA:
code review:     OK
py3 migration:   OK

manual test of the distribution module via UMC:    OK
at jobs:                                           OK
new error handling:                                OK

No related errors in log files: OK
No related tests that failed:   OK
Comment 6 Jürn Brodersen univentionstaff 2021-11-29 17:20:19 CET
UCS@school 5.0 v1 has been released.

https://docs.software-univention.de/release-notes-ucsschool-5.0v1-de.html

If this error occurs again, please clone this bug.