Univention Bugzilla – Bug 50401
Migrate udm_extension.py of univention-directory-manager-modules to dh_python2
Last modified: 2020-01-15 16:59:58 CET
The listener/udm_extension.py module writes python symlinks and files to certain pathes using python-support. This must be migrated and all existing files migrated. +++ This bug was initially created as a clone of Bug #49147 +++ The package management/univention-directory-manager-modules should be migrated to use dh_python instead of python-support. Migration-Guide: https://hutten.knut.univention.de/mediawiki/index.php/Python_DebHelper_Migration
Consider Bug #49147 comment 1, 2, 3 and 4 when fixing this.
WIP branch: git:fbest/50401-udm-listener-dh-python
Updated the branch, the patch should now work but it requires a: univention-directory-listener-ctrl resync udm_extension to let the initialize() function run, which does the migration.
I accidently commited with the wrong bug number (Bug #49147): univention-directory-manager-modules (14.0.14-19) 0210701a136d | Bug #49147: add logging to deprecated pathes ac20bd8fe91c | Bug #49147: migrate listener udm_extension.py to dh-python QA 1: compare the files between upgrading, ideally with some apps like ucsschool, oxseforucs installed: Before upgrade: find /usr/share/pyshared/univention/admin/ /usr/lib/pymodules/python2.7/univention/admin/ /usr/lib/python2.7/dist-packages/univention/admin > admin.pre After upgrade: find /usr/share/pyshared/univention/admin/ /usr/lib/pymodules/python2.7/univention/admin/ /usr/lib/python2.7/dist-packages/univention/admin > admin.post vimdiff admin.pre admin.post QA 2: test this also with apps (e.g. oxseforucs) which are still installing the python files to the old locations. QA 3: test this also with apps (e.g. univention-s4-connector) which are still installing the python files already to the new location QA 4: the registration after the upgrade should still work
Adjusted the path for the test cases: ucs-test (9.0.3-130) 127bff120673 | Bug #50401: adjust pyshared pathes
Reopen: In "def initialize", please put the "listener.unsetuid()" into a finally. Also I don't think the handler function needs "listener.setuid(0)", it should handle that by itself. Or does that not work? Nice to have: The initialize function would look cleaner if the migration part is moved into a function :) I would also like a debug message in case a module is migrated and a message after the migration has completed. Unsure: The listener does not create byte compiled files any more. Not really a problem but different to the old behaviour as far as I can tell. A "pycompile $DIR" should help. What I tested so far: Migration works on master, backup, slave and member -> OK What I still need to test: Some more apps (ox, s4-connector, office365)
(In reply to Jürn Brodersen from comment #6) > Reopen: > In "def initialize", please put the "listener.unsetuid()" into a finally. Ok. > Also I don't think the handler function needs "listener.setuid(0)", it > should handle that by itself. Or does that not work? It is necessary, several functions are calling unsetuid(). > Nice to have: > The initialize function would look cleaner if the migration part is moved > into a function :) initialize() only does the migration. Added call to a single function from initialize()… > I would also like a debug message in case a module is migrated and a message > after the migration has completed. Okay, added as INFO (which is then never printed by default). > Unsure: > The listener does not create byte compiled files any more. Not really a > problem but different to the old behaviour as far as I can tell. A > "pycompile $DIR" should help. Well, I don't think this is necessary and not even used (code is: execfile(open(udm_syntax)). But I added it nevertheless. univention-directory-manager-modules (14.0.14-21) bca3b76ad482 | Bug #44135: add pycompiling, etc.
Test for the migration: [4.4-3 417b514989] Bug #50401: 72_udm-extensions/50_test_pysupport_to_dhpython_migration Tests OK Apps OK yaml OK -> Verified
Reopen: At least ucs-tests for ucs@school regarding udm extensions failed for some runs https://jenkins.knut.univention.de:8181/job/UCSschool-4.4/job/Install%20Singleserver/359/testReport/
Back to verified: The schooltests were running with an up-to-date ucs-test, but the erratum developed at this bug has not been released, so the tests failed.
<http://errata.software-univention.de/ucs/4.4/421.html>