Bug 41775 - ucs-school-import: --no-delete option prevents explicitly desired deletion
ucs-school-import: --no-delete option prevents explicitly desired deletion
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.1 R2 vXXX
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-12 10:57 CEST by Daniel Tröder
Modified: 2016-10-04 13:24 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.137
Enterprise Customer affected?:
School Customer affected?: Yes
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 2016-07-12 10:57:19 CEST
If the input data contains a column that explicitly sets "action=D" for an ImportUser, than the user should be deleted. Currently a check for "no-delete" in UserImport.delete_users() prevents any deletion of users.

This is needed for the new operation mode "change user database according to this input" (previously the only operation mode was "change user database to this target state").
Comment 1 Daniel Tröder univentionstaff 2016-07-12 11:03:42 CEST
Fixed in r70936
Advisory (build number): r70937
Comment 2 Daniel Tröder univentionstaff 2016-07-12 11:13:08 CEST
Write a test.
Comment 3 Daniel Tröder univentionstaff 2016-07-28 15:23:16 CEST
added a test in r71279
Comment 4 Daniel Tröder univentionstaff 2016-07-29 10:30:42 CEST
Fixed test and notifier handling in r 71286, 71287, 71288.

(Fixing notifier shutdown for jenkins failing on 90_ucsschool/34_import-users_via_cli: http://jenkins.knut.univention.de:8080/job/UCSschool%204.1/job/UCSschool%204.1%20(R2)%20Singleserver/SambaVersion=s3/184/testReport/junit/90_ucsschool/34_import-users_via_cli/test/ )
Comment 5 Daniel Tröder univentionstaff 2016-08-01 11:23:03 CEST
The test does not test the case where an explicitly desired deletion is in the CSV file (like in a legacy CSV file) and did thus not show, that the code currently does actually not allow it.
Comment 6 Daniel Tröder univentionstaff 2016-08-01 15:22:50 CEST
Fixed in r71302.

Unfortunately the new code is almost a copy of LegacyUserImport.detect_users_to_delete(), but because of some self-references in detect_users_to_delete(), using that method in the non-legacy UserImport would have made subclassing it confusing, if not unsafe.

Added a test, forcing action=D in import with --no-delete: r71306.
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2016-08-24 14:47:10 CEST
ucs-school-lib:
OK: code change
OK: functional test
OK: ucs-test
OK: YAML has been updated

ucs-school-import:
OK: code change + reworded cmdline help
OK: functional test
OK: ucs-test
OK: YAML has been updated

Package: ucs-school-import
Version: 14.0.16-1.301.201608241442

Package: ucs-test-ucsschool
Version: 3.0.14-13.250.201608241442

ucs-school-lib.yaml:
r71902 | Bug #41775: updated advisory

ucs-school-import (14.0.16-1):
r71903 | Bug #41775: reworded cmdline description

ucs-test-ucsschool (3.0.14-13):
r71905 | Bug #41775: renamed 1 function/ 1 variable for better readability

ucs-school-import.yaml:
r71904 | Bug #41775: updated advisory

A final jenkins run is missing.
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2016-08-26 16:45:59 CEST
Waiting for 34_import-users_via_cli_v2.test...
Comment 9 Daniel Tröder univentionstaff 2016-09-12 10:55:29 CEST
This is tested in 34_import-users_via_cli_v2 in methods test_create_modify_only() and test_no_delete_option().
Comment 10 Sönke Schwardt-Krummrich univentionstaff 2016-09-15 16:02:45 CEST
(In reply to Sönke Schwardt-Krummrich from comment #8)
> Waiting for 34_import-users_via_cli_v2.test...

Test was several times successful.
→ VERIFIED
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2016-10-04 13:24:53 CEST
UCS@school 4.1 R2 v5 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.1R2v5-de.html

If this error occurs again, please clone this bug.