Univention Bugzilla – Bug 47155
deleting a school doesn't delete its central groups
Last modified: 2020-06-10 14:36:54 CEST
When a school is deleted, only the OU is removed from LDAP, but the groups admins-$OU, lehrer-$OU, mitarbeiter-$OU, OU$OU-DC-Edukativnetz etc are not removed.
Implemented overridden function remove_without_hooks in school.py which removes the mentioned group udm objects. The implementation mainly corresponds to cleanup_ou() in ucs_test_school.py. It additionally calls user.remove_from_school() for each user of this school. Functionality was tested by adding and then removing a school from ldap via UMC. Solution pushed to branch troehmey/bug47155 with commits commit 683a4f83e4ffc0e52b75e2073729825c03fa5cc4 (HEAD -> troehmey/bug47155, origin/troehmey/bug47155) Author: Toni Röhmeyer <roehmeyer@univention.de> Date: Thu May 7 14:35:54 2020 +0200 Bug #47155: remove users from school commit a3b00fd482c0b3ffc4d95e788b3b2a2553cb3918 Author: Toni Röhmeyer <roehmeyer@univention.de> Date: Wed May 6 20:31:13 2020 +0200 Bug #47155: override remove_without_hooks
QA Unfortunately the groups were not deleted -> reopen The variable `user_containers` (-> remove_without_hooks) is not known at this point. Please check, if you actually need to delete them this way. logger -> self.logger
I'm sorry. Apparently I tested the wrong code. I fixed the issue. The intended implementation was pushed to branch troehmey/bug47155 with commit commit 54bc4788289759afddd1110e05c58e4c2d4680e2 Bug #47155: fixed error
QA -> reopen Please dedent the for-loop, it only needs to be called once per school for user in User.get_all(lo, self.name)
Thanks for the hint! For-loop has been dedented with commit commit 7b3a43e7b8080916ee647a28fe20cd4cd9b898b2 Bug #47155: dedent for-loop on branch troehmey/bug47155.
QA -> all ok Code -> ok Functionality -> ok please merge, add changelog and yaml & build in 4.4 Functionality was tested by adding and then removing a school from ldap via UMC. After the change the school's groups and users inside were removed. [troehmey/bug47155] 7b3a43e7b Bug #47155: dedent for-loop [troehmey/bug47155] 54bc47882 Bug #47155: fixed error [troehmey/bug47155] 683a4f83e Bug #47155: remove users from school [troehmey/bug47155] a3b00fd48 Bug #47155: override remove_without_hooks
Feature branch was merged into 4.4 with the following commits: commit e4de093174b2f087cc8144b0af3fc6f6affa380a Bug #47155: added yaml entry commit 6d30dda0651863c938df8a864955413f9866c314 Bug #47155: add changelog entry commit d6e55007a929b4261984c8065a2ea4c3d8e6f87f Bug #47155: Merge branch 'troehmey/bug47155' into 4.4 Successful build: Package: ucs-school-lib Version: 12.1.14A~4.4.0.202005121819 Branch: ucs_4.4-0 Scope: ucs-school-4.4
Please check if this is related: https://jenkins.knut.univention.de:8181/job/UCSschool-4.4/job/Install%20Singleserver/479/Config=s4,TestGroup=base1,UCSRelease=public/testReport/junit/90_ucsschool/29_schools_module/master201/
The changes made before caused test 29_schools_module to fail, because testing School.verify_ou still expected the ou-groups (should_exist=True instead of should_exist=must_exist). I changed this and added try/except block in the finally block in 29_school_module. Successful build Package: ucs-test-ucsschool Version: 6.0.110A~4.4.0.202005131647 Branch: ucs_4.4-0 Scope: ucs-school-4.4 [4.4] 382f69cd6 Bug #47155: Fix test 29 & adjust School.verify_ldap
The jenkins tests are now passed. https://jenkins.knut.univention.de:8181/job/UCSschool-4.4/job/Install%20Singleserver/480/Config=s4,TestGroup=base1,UCSRelease=public/testReport/junit/90_ucsschool/29_schools_module/
UCS@school 4.4 v5 has been released (errata update to the release). https://docs.software-univention.de/changelog-ucsschool-4.4v5-de.html If this error occurs again, please clone this bug.