Univention Bugzilla – Bug 53756
Abort upgrade from UCS 4.4 to 5.0 if hooks for UCS@school-Import are not Python 3 compatible
Last modified: 2022-06-27 21:09:53 CEST
An upgrade from UCS 4.4 to UCS 5.0 should be aborted if the user has Python-Hooks for the UCS@school-Import installed, that are not Python 3 compatible. The pre-up.sh script should scan installed UCS@school Import-Hooks für Python 3 compatibility.
The hooks are in /usr/share/ucs-school-import/hooks/*/*.py and /usr/share/ucs-school-import/pyhooks/*.py ? Or are there more locations?
Sorry, I should have mentioned that earlier. Below /usr/share/ucs-school-import/hooks were only run-part hooks, mostly shell. Nowadays there should be nothing anymore. Python hooks are directly below two directories: * /usr/share/ucs-school-import/checks/ * /usr/share/ucs-school-import/pyhooks/
Added a preup.sh check which checks the python 3 syntax compatibility of: /usr/share/ucs-school-import/checks/**/*.py /usr/share/ucs-school-import/pyhooks/**/*.py 4eae66c08896 | Bug #53756: check hooks for Python 3 compatibility in preup.sh
Works: Do you want to continue [Y|n]? n Checking for app updates: skipped Checking for release updates: found: UCS 5.0-0 Do you want to update to 5.0-0 [Y|n]? Y Starting update to UCS version 5.0-0 Checking python_ucsschool_import_hook_compatibility ... FAIL The system can not be updated to UCS due to the following reasons: python_ucsschool_import_hook_compatibility: The following UCS@school Import Hooks are not compatible with Python 3: /usr/share/ucs-school-import/pyhooks/myhook.py Error: Please check "/var/log/univention/updater.log" for details. ERROR: update failed. Please check /var/log/univention/updater.log Should we add this test to https://updates.software-univention.de/download/univention-update-checks/pre-update-checks-5.0-0 so that customers can check the update "readiness" of their systems.
* ucsschool preup.sh reverted + published * UCS check.sh + preup.sh updated + published
OK - removed from school preup OK - pre-update-checks-5.0-0 -> curl -OOf https://updates.software-univention.de/download/univention-update-checks/pre-update-checks-5.0-0{.gpg,} -> apt-key verify pre-update-checks-5.0-0{.gpg,} gpgv: Signature made Fr 17 Sep 2021 11:28:25 CEST gpgv: using RSA key D293E501A055F562 gpgv: Good signature from "Univention Corporate Server 5.x <packages@univention.de>" -> bash pre-update-checks-5.0-0 update_check_python_ucsschool_import_hook_compatibility Starting pre-update-checks-5.0-0 (Fr 17. Sep 12:06:33 CEST 2021): dpkg-query: Kein Pfad gefunden, der auf Muster /usr/share/ucs-school-import/pyhooks/myhook.py passt The following UCS@school Import Hooks are not compatible with Python 3: /usr/share/ucs-school-import/pyhooks/myhook.py OK - ucs5.0-0 preup -> univention-upgrade --ignoressh --ignoreterm --disable-app-updates ... Starting update to UCS version 5.0-0 ... Checking python_ucsschool_import_hook_compatibility ... FAIL ... The system can not be updated to UCS 5.0 due to the following reasons: python_ucsschool_import_hook_compatibility: The following UCS@school Import Hooks are not compatible with Python 3: /usr/share/ucs-school-import/pyhooks/myhook.py Error: Please check "/var/log/univention/updater.log" for details. ERROR: update failed. Please check /var/log/univention/updater.log