Bug 47691 - check for mandatory_attributes doesn't consider attribute contents
check for mandatory_attributes doesn't consider attribute contents
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.3
Other Linux
: P5 normal (vote)
: UCS@school 4.3 v6
Assigned To: Daniel Tröder
Ole Schwiegert
:
Depends on:
Blocks: 47681 48655
  Show dependency treegraph
 
Reported: 2018-08-29 08:21 CEST by Daniel Tröder
Modified: 2019-02-12 12:13 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a 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.069
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 2018-08-29 08:21:12 CEST
The import has a configuration option "mandatory_attributes" that should check if a user attribute has been set. The documentation states in two places:
----------------------------------------------------------------------------
"mandatory_attributes": list: list of UDM attribute names that must be set by the import
----------------------------------------------------------------------------
Liste mit Univention Directory Manager Attributnamen, die während des Imports aus den Eingabedaten oder indirekt über ein Schema gesetzt werden müssen.
----------------------------------------------------------------------------

The user object validation code however only checks if the attributes exist, but doesn't fail if they are empty.
Comment 1 Daniel Tröder univentionstaff 2018-09-17 10:37:43 CEST
Fixed in branch dtroeder/47691_mandatory_attributes_contents:

ef40da36f: Bug #47691: check properties in config['mandatory_attributes'] exist and are non-empty

If a UDM property or User attribute that is listed in config['mandatory_attributes'] does not exist MissingMandatoryAttribute is raised.

If a UDM property or User attribute that is listed in config['mandatory_attributes'] exists but is empty ('' or None) EmptyMandatoryAttribute is raised.
Comment 2 Ole Schwiegert univentionstaff 2018-10-01 08:35:51 CEST
Test passes for me and also the Exceptions are raised in run and dry-run when expected.

Please build, so I can do final testing.
Comment 3 Daniel Tröder univentionstaff 2018-10-01 10:00:55 CEST
Thanks for testing.
Changelog added, built, advisory.
Comment 4 Ole Schwiegert univentionstaff 2018-10-02 08:41:53 CEST
A test fails now:

90_ucsschool.114_importuser_udm_properties_udm_syntax_checks.test
Comment 6 Daniel Tröder univentionstaff 2018-10-02 10:04:28 CEST
[4.3] 39d15a5b0 Bug #47691: fix test not setting source_uid

ucs-test-ucsschool (5.0.2-97)
Comment 7 Ole Schwiegert univentionstaff 2018-10-04 09:05:59 CEST
Changelog & Advisory: OK
Package installs: OK
Works: OK (like before)

Looks all fine for me now.
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2018-11-16 11:48:07 CET
UCS@school 4.3 v6 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.3v6-de.html

If this error occurs again, please clone this bug.