Bug 47155 - deleting a school doesn't delete its central groups
deleting a school doesn't delete its central groups
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Wizards
UCS@school 4.2
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Toni Röhmeyer
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-07 08:25 CEST by Daniel Tröder
Modified: 2020-06-10 14:36 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.023
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2018-06-07 08:25:19 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.
Comment 1 Toni Röhmeyer univentionstaff 2020-05-07 14:42:29 CEST
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
Comment 2 Tobias Wenzel univentionstaff 2020-05-08 15:02:48 CEST
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
Comment 3 Toni Röhmeyer univentionstaff 2020-05-08 19:10:49 CEST
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
Comment 4 Tobias Wenzel univentionstaff 2020-05-11 14:55:35 CEST
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)
Comment 5 Toni Röhmeyer univentionstaff 2020-05-12 13:53:54 CEST
Thanks for the hint!

For-loop has been dedented with commit

commit 7b3a43e7b8080916ee647a28fe20cd4cd9b898b2
Bug #47155: dedent for-loop

on branch troehmey/bug47155.
Comment 6 Tobias Wenzel univentionstaff 2020-05-12 16:15:03 CEST
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
Comment 7 Toni Röhmeyer univentionstaff 2020-05-12 18:25:09 CEST
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
Comment 9 Tobias Wenzel univentionstaff 2020-05-13 17:00:53 CEST
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
Comment 11 Ole Schwiegert univentionstaff 2020-06-10 14:36:54 CEST
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.