Univention Bugzilla – Bug 50497
Regression: Creating directory reports and univention-directory-reports-cleanup script does not work since UCS 4.4e346
Last modified: 2019-11-27 14:20:09 CET
https://help.univention.com/t/13590 In our forum we got a report that univention-directory-reports-cleanup does not work with UCS 4.4e346 and later. There is a cronjob which runs the cleanup script, which also generates errormails. # /usr/sbin/univention-directory-reports-cleanup Traceback (most recent call last): File "/usr/sbin/univention-directory-reports-cleanup", line 46, in <module> for f in os.listdir(dirname): OSError: [Errno 2] No such file or directory: '/usr/share/univention-management-console-module-udm' With version univention-management-console-module-udm the directory /usr/share/univention-management-console-module-udm is not created anymore/removed upon package installation. +++ This bug was initially created as a clone of Bug #49160 +++
It gets regulary created: dh_installdirs install -d debian/univention-management-console-module-udm/usr/share/univention-management-console-module-udm And then: override_dh_python2: ls debian/univention-management-console-module-udm/usr/share/ dh_python2 ls debian/univention-management-console-module-udm/usr/share/ After dh_python2 is executed, the folder is removed...
Trying to generate a report in UMC also fails, traceback: Interner Server-Fehler in "udm/reports/create (users/user)". Request: udm/reports/create (users/user) File "/usr/lib/pymodules/python2.7/notifier/threads.py", line 78, in _run tmp = self._function() File "/usr/lib/pymodules/python2.7/notifier/__init__.py", line 104, in __call__ return self._function( *tmp, **self._kwargs ) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/udm_ldap.py", line 97, in _decorated File "/usr/lib/python2.7/dist-packages/univention/management/console/ldap.py", line 143, in _decorated result = func(*args, **kwargs) File "/usr/lib/pymodules/python2.7/univention/management/console/modules/udm/__init__.py", line 668, in _thread File "/usr/lib/python2.7/shutil.py", line 302, in move copy2(src, real_dst) File "/usr/lib/python2.7/shutil.py", line 130, in copy2 copyfile(src, dst) File "/usr/lib/python2.7/shutil.py", line 83, in copyfile with open(dst, 'wb') as fdst: IOError: [Errno 21] Ist ein Verzeichnis: '/usr/share/univention-management-console-module-udm/'
Fixed by re-installing the directory after the dh_python debhelpers ran. univention-management-console-module-udm.yaml 6f7d74536d9f | YAML Bug #50497 univention-management-console-module-udm (9.0.15-4) 88fdd65129c3 | Bug #50497: fix installation of directory usr/share/univention-management-console-module-udm/
<man:dh_python2> > private dirs > /usr/share/foo, … private directories are scanned for Python files by default (where foo is binary package name). … … > --skip-private > don't check private directories dh_python[23] walks debian/$binpkg/usr/share/$binpkg/ and removed every empty directory through /usr/share/dh-python/dhpython/fs.py # Scan.__init__ > if not dirs: > try: > os.removedirs(root) > except OSError: > pass $ cat >>debian/rules <<__EOF__ override_dh_python2: dh_python2 --skip-private override_dh_python3: dh_python3 --skip-private ___EOF__ $ dpkg -c ../univention-management-console-module-udm_9.0.15-3_all.deb | grep /usr/share/univention-management-console-module-udm drwxr-xr-x root/root 0 2019-10-23 15:28 ./usr/share/univention-management-console-module-udm/
I don't really understand why this happens and why it doesn't happen in other packages.
Thanks Philipp, using --skip-private now. univention-management-console-module-udm (9.0.15-5) 149108c96a42 | Bug #50497: use --skip-private
(In reply to Florian Best from comment #5) > I don't really understand why this happens and why it doesn't happen in > other packages. Because the other packages probably have files and/or sub-directories with non-Python-files under that path and so don't become empty after the dh_python[23] run.
OK - reports OK - cron job OK - yaml added test case 01_base/71_directory_reports
*** Bug 50534 has been marked as a duplicate of this bug. ***
<http://errata.software-univention.de/ucs/4.4/378.html>