Univention Bugzilla – Bug 54074
OX scripts not migrated to Python 3
Last modified: 2022-05-09 12:02:59 CEST
At least the spamrunner script was not migrated: root@ucsl-02:~# python3 /usr/sbin/spamrunner Traceback (most recent call last): File "/usr/sbin/spamrunner", line 207, in <module> if not os.path.exists('%s/Maildir' % (get_user_home(user["send_addr"],))): File "/usr/sbin/spamrunner", line 102, in get_user_home return read_from_ext_proc(cmd) File "/usr/sbin/spamrunner", line 90, in read_from_ext_proc syslog.syslog(syslog.LOG_ERR, cmd_err) TypeError: [priority,] message string
Issue: TypeError occures when syslog should be written (caused by python3 migration) Fix: incrementing used interpreter version to 3.7 converted "cmd_err" from bytestring to string requesting QA
QA -> Reopen code review: use #!/usr/bin/python3 instead of python3.7 aside from that the code looks good.
issue: see "Description" fix: changed used pythonversion from 3.7 to 3, fixed verbose option fixed with: asteffen/54074-OX-scripts-not-migrated-to-python3 requesting QA
adopted suggested stringhandling by tobias wenzel
QA: I hadn't seen, that `strip` was used there before. Simply replace (your) `rstrip` with `strip` (-> `(cmd_out.decode("utf-8").strip()`). The rest looks good and has been tested by running the script with and without parameters. ``` ucr get server/role domaincontroller_slave UCS: 5.0-1 errata199 Installed: mailserver=12.0 oxseforucs=7.10.5-ucs4 ``` Then you can squash your commits, merge to `5.0` and build. ``` [asteffen/54074-OX-scripts-not-migrated-to-python3] d848a483 Bug #54074: changed string processing to a more adequat solution [asteffen/54074-OX-scripts-not-migrated-to-python3] d44fb93f Bug #54074: fixed migration errors of spamrunners verbose option [asteffen/54074-OX-scripts-not-migrated-to-python3] dfb6046e Bug 54074 - changed used python version from 2.7 to 3.7, converted cmr_err bytestring to string ``` afterwards, set the bug to resolved/fixed (we don't use moved here).
Successful build Package: univention-mail-dovecot-ox Version: 4.0.0-12A~5.0.0.202202031235 Branch: ucs_5.0-0 Scope: oxse4ucs merged and built
REOPEN: https://git.knut.univention.de/univention/open-xchange/appsuite/-/commit/a1c5c3578225be7b3eaded7a3beabf13ec8110c7#note_52238 A merge request workflow would help here.
Thanks for the remarks! 5.0 - Bug #54074: fixed remaining migration error Successful build Package: univention-mail-dovecot-ox Version: 4.0.0-13A~5.0.0.202202071033 Branch: ucs_5.0-0 Scope: oxse4ucs
The commits so far were: univention-mail-dovecot-ox.yaml 43da0191d0df | Bug #54074: changelog univention-mail-dovecot-ox (4.0.0-13) a438f30341d7 | Bug #54074: fixed remaining migration error univention-mail-dovecot-ox (4.0.0-12) 008032c1ecd9 | Bug #54074: changelog univention-mail-dovecot-ox (4.0.0-11) a1c5c3578225 | Bug #54074: migrated spamrunner to python3 I added another one: univention-mail-dovecot-ox (4.0.1-2) 8ce8291a5df1 | Bug #54074: make spamrunner code style PEP8 compatible
I'm very sorry for letting you wait and thank's a lot for the changes you commited. I tested the script again -> all ok already built in main branch Successful build Package: univention-mail-dovecot-ox Version: 4.0.1-1A~5.0.0.202205061437 Branch: ucs_5.0-0 Scope: oxse4ucs all ok -> verify
Released in already published 7.10.5-ucs4 in an emergency update due to Bug#54723