Univention Bugzilla – Bug 42862
listener/udm_extension.py doesn't cleanup when file changes
Last modified: 2017-07-05 13:06:33 CEST
If the filename property of settings/udm_hook settings/udm_syntax settings/udm_module changes the corresponding python files aren't removed by the listener module udm_extension.py. This causes several dead files after running the ucs-test script 72_udm-extensions/24_update_packageversion. # ls /usr/share/pyshared/univention/admin/handlers/ucstest/ b1wwyprydy.py cs2sapmzep.py frng4064cp.py __init__.py krzdl9qjwl.py r4046zqgjb.py ue7apx0p4e.py vde7jooqde.py vzim57snkq.py wudd92bykm.py c76smp3n3w.py ej0iyhq6vp.py hq7c6wc7td.py jw5ef80n1w.py pzgpw74als.py rht4gq9zmq.py uxafemexbl.py vljwxsi7sl.py wprjh759ic.py zdfypds6vc.py # ls /usr/share/pyshared/univention/admin/hooks.d/ dv3t6owj7f.py e21reckhtz.py furj3agw0s.py gpxxx3v08e.py __init__.py lumr3d2tel.py ogrqmcm85g.py s7xlbkk9if.py schoolAdminGroup.py schoolOU.py ucsschool_user_options.py utg5k6hrrg.py wfj338v6kq.py xmpgzkt03w.py # ls /usr/share/pyshared/univention/admin/syntax.d/ example.py hisxvb6njt.py jhg9gpbxke.py kqw98el8fa.py kvs9vq1ott.py mbon8qutup.py nn523am0uk.py q3ptxgdsom.py qzh4ttvrim.py samlserviceprovider.py syntax.ucs-school-import.py tk8q3z1xkb.py ucc.py univention-virtual-machine-manager-schema.py zy9lds4etn.py
Created attachment 8194 [details] patch
(In reply to Florian Best from comment #1) > Created attachment 8194 [details] > patch Applied patch: r 80782 univention-directory-manager-modules (12.0.17-50) * Bug #42862: Applied patch from Florian Best - Fix listener/udm_syntax.py not cleaning up files YAML: r 80785
OK: test: service univention-directory-listener restart ucs-test 72_udm-extensions/24_update_packageversion ls /usr/share/pyshared/univention/admin/handlers/ucstest/ /usr/share/pyshared/univention/admin/hooks.d/ /usr/share/pyshared/univention/admin/syntax.d/ OK: YAML (adjusted in r80787)
Traceback (most recent call last): File "/usr/lib/univention-directory-listener/system/udm_extension.py", line 104, in handler old_relative_filename = old.get('%sFilename' % objectclass)[0] TypeError: 'NoneType' object has no attribute '__getitem__'
(In reply to Florian Best from comment #4) > Traceback (most recent call last): > File "/usr/lib/univention-directory-listener/system/udm_extension.py", > line 104, in handler > old_relative_filename = old.get('%sFilename' % objectclass)[0] > TypeError: 'NoneType' object has no attribute '__getitem__' r 80813 univention-directory-manager-modules (12.0.17-54) * Bug #42862: Applied patch from Florian Best - Prevent crash if old file does not exist
OK: the tests work now again. I added another ucs-test case which tests the removal of renamed files: ucs-test (7.0.22-16): r80815 | Bug #42862: add test for renamed filenames causes old files to be removed
<http://errata.software-univention.de/ucs/4.2/79.html>