Bug 42456 - Import is case insensitive
Import is case insensitive
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.1 R2
Other Linux
: P5 normal (vote)
: UCS@school 4.2 v4
Assigned To: Daniel Tröder
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-21 10:37 CEST by Sönke Schwardt-Krummrich
Modified: 2017-10-16 21:33 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: 2016091621002446
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 Sönke Schwardt-Krummrich univentionstaff 2016-09-21 10:37:01 CEST
A customer imported via the *legacy* import script a bunch of new users but did  specify the upper case variant of the OU ("MYSCHOOL") whereas the OU and all other users have been imported with OU "myschool". 
Though the MYSCHOOL-users used "MYSCHOOL" in ucsschoolSchools which triggered some problems (at least with ucs-school-migrate-to-4.1R2).

The import should check if the OU exists and a) convert the CSV data to correct case or b) reject the import.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2017-08-28 08:55:46 CEST
(In reply to Sönke Schwardt-Krummrich from comment #0)
> A customer imported via the *legacy* import script a bunch of new users but

I do not remember if the OLD legacy import script triggered this error or if the NEW import script was the culprit.
Comment 2 Daniel Tröder univentionstaff 2017-09-26 10:16:40 CEST
"b) reject the import" is already the case:

Using the "new" import script:

$ cd /usr/share/ucs-school-import
$ ./scripts/ucs-school-testuser-import --nostart --staff 1 --verbose NoSchool
$ ./scripts/ucs-school-user-import --conffile configs/ucs-school-testuser-import.json --infile test_users_2017-09-26_10\:05\:06.csv --verbose
[..]
2017-09-26 10:06:36 DEBUG base.cache:210  Initializing ('School', ('name', 'NoSchool'))
2017-09-26 10:06:36 DEBUG base.get_udm_object:666  Getting School UDM object by dn: ou=NoSchool,dc=uni,dc=dtr
2017-09-26 10:06:36 ERROR user_import.create_and_modify_users:163  Entry #0: ValidationError when adding ImportStaff(name='reelef.muenc', school='NoSchool', dn='uid=reelef.muenc,cn=mitarbeiter,cn=users,ou=NoSchool,dc=uni,dc=dtr', old_dn=None) (source_uid:TESTID record_uid: Reelef.Münch): {'school': ['The school "NoSchool" does not exist. Please choose an existing one or create it.']}
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 135, in create_and_modify_users
    success = user.create(lo=self.connection)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 164, in create
    return super(ImportUser, self).create(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 427, in create
    success = self.create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 440, in create_without_hooks
    raise ValidationError(self.errors.copy())
UserValidationError: ValidationError when adding ImportStaff(name='reelef.muenc', school='NoSchool', dn='uid=reelef.muenc,cn=mitarbeiter,cn=users,ou=NoSchool,dc=uni,dc=dtr', old_dn=None) (source_uid:TESTID record_uid: Reelef.Münch): {'school': ['The school "NoSchool" does not exist. Please choose an existing one or create it.']}

------------------------------------------------------------

Using the "new legacy" import script:

$ cd /usr/share/ucs-school-import
$ ./scripts/ucs-school-create-dummy-users NoSchool | head -1 > test_users_legacy.csv
$ ./scripts/import_user test_users_legacy.csv
[..]
2017-09-26 10:12:18 DEBUG base.cache:210  Initializing ('School', ('name', 'NoSchool'))
2017-09-26 10:12:18 DEBUG base.get_udm_object:666  Getting School UDM object by dn: ou=NoSchool,dc=uni,dc=dtr
2017-09-26 10:12:18 DEBUG base.get_only_udm_obj:869  Getting LegacyImportStudent UDM object by filter: &(!(uid=anton1))(mailPrimaryAddress=Anton1@uni.dtr)
2017-09-26 10:12:18 ERROR user_import.create_and_modify_users:163  Entry #0: ValidationError when adding LegacyImportStudent(name=u'anton1', school='NoSchool', dn=u'uid=anton1,cn=schueler,cn=users,ou=NoSchool,dc=uni,dc=dtr', old_dn=None) (source_uid:LegacyDB record_uid: Anton1): {'school': ['The school "NoSchool" does not exist. Please choose an existing one or create it.']}
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 135, in create_and_modify_users
    success = user.create(lo=self.connection)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 164, in create
    return super(ImportUser, self).create(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 427, in create
    success = self.create_without_hooks(lo, validate)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 440, in create_without_hooks
    raise ValidationError(self.errors.copy())
UserValidationError: ValidationError when adding LegacyImportStudent(name=u'anton1', school='NoSchool', dn=u'uid=anton1,cn=schueler,cn=users,ou=NoSchool,dc=uni,dc=dtr', old_dn=None) (source_uid:LegacyDB record_uid: Anton1): {'school': ['The school "NoSchool" does not exist. Please choose an existing one or create it.']}

------------------------------------------------------------

The "old legacy" import script is not maintained anymore, but it is the one doing the automatic OU creation:

 ./scripts/ucs-school-import test_users_legacy.csv
infile is: test_users_legacy.csv
Processing line 1: A	Anton1	Meyer	Anton	NoSchool	NoSchool-1A		Anton1@uni.dtr	0	1	0
verify ou for school nr NoSchool
need to create group cn=OUnoschool-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
creating object cn=OUnoschool-DC-Verwaltungsnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
need to create group cn=OUnoschool-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
creating object cn=OUnoschool-Member-Verwaltungsnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
need to create group cn=OUnoschool-DC-Edukativnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
creating object cn=OUnoschool-DC-Edukativnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
need to create group cn=OUnoschool-Member-Edukativnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
creating object cn=OUnoschool-Member-Edukativnetz,cn=ucsschool,cn=groups,dc=uni,dc=dtr
need to create container ou=NoSchool,dc=uni,dc=dtr
creating object ou=NoSchool,dc=uni,dc=dtr
need to create container cn=printers,ou=NoSchool,dc=uni,dc=dtr
creating object cn=printers,ou=NoSchool,dc=uni,dc=dtr
[..]
creating object cn=NoSchool-1A,cn=klassen,cn=schueler,cn=groups,ou=NoSchool,dc=uni,dc=dtr
need to create groupshare cn=NoSchool-1A,cn=klassen,cn=shares,ou=NoSchool,dc=uni,dc=dtr
creating object cn=NoSchool-1A,cn=klassen,cn=shares,ou=NoSchool,dc=uni,dc=dtr
creating object uid=anton1,cn=schueler,cn=users,ou=NoSchool,dc=uni,dc=dtr
created: uid=anton1,cn=schueler,cn=users,ou=NoSchool,dc=uni,dc=dtr

------------------------------------------------------------

Closing the bug, because the "old legacy" import script is not supported anymore and all other versions behave correctly.
Comment 3 Florian Best univentionstaff 2017-09-27 17:18:24 CEST
(In reply to Sönke Schwardt-Krummrich from comment #0)
> A customer imported via the *legacy* import script a bunch of new users but
> did  specify the upper case variant of the OU ("MYSCHOOL") whereas the OU
> and all other users have been imported with OU "myschool". 
> Though the MYSCHOOL-users used "MYSCHOOL" in ucsschoolSchools which
> triggered some problems (at least with ucs-school-migrate-to-4.1R2).
some problems ==
ldapError: uid=****,cn=lehrer,cn=users,ou=***,dc=schulen,dc=****,dc=de: Type or value exists: ucsschoolSchool: value #0 provided more than once
Comment 4 Florian Best univentionstaff 2017-09-27 17:22:46 CEST
(In reply to Daniel Tröder from comment #2)
> "b) reject the import" is already the case:
> 
> Using the "new" import script:
> 
> $ cd /usr/share/ucs-school-import
> $ ./scripts/ucs-school-testuser-import --nostart --staff 1 --verbose NoSchool
> $ ./scripts/ucs-school-user-import --conffile
> configs/ucs-school-testuser-import.json --infile
> test_users_2017-09-26_10\:05\:06.csv --verbose
> [..]
> 2017-09-26 10:06:36 DEBUG base.cache:210  Initializing ('School', ('name',
> 'NoSchool'))
> 2017-09-26 10:06:36 DEBUG base.get_udm_object:666  Getting School UDM object
> by dn: ou=NoSchool,dc=uni,dc=dtr
> 2017-09-26 10:06:36 ERROR user_import.create_and_modify_users:163  Entry #0:
> ValidationError when adding ImportStaff(name='reelef.muenc',
> school='NoSchool',
> dn='uid=reelef.muenc,cn=mitarbeiter,cn=users,ou=NoSchool,dc=uni,dc=dtr',
> old_dn=None) (source_uid:TESTID record_uid: Reelef.Münch): {'school': ['The
> school "NoSchool" does not exist. Please choose an existing one or create
> it.']}
> Traceback (most recent call last):
>   File
> "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py",
> line 135, in create_and_modify_users
>     success = user.create(lo=self.connection)
>   File
> "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py",
> line 164, in create
>     return super(ImportUser, self).create(lo, validate)
>   File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line
> 427, in create
>     success = self.create_without_hooks(lo, validate)
>   File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line
> 440, in create_without_hooks
>     raise ValidationError(self.errors.copy())
> UserValidationError: ValidationError when adding
> ImportStaff(name='reelef.muenc', school='NoSchool',
> dn='uid=reelef.muenc,cn=mitarbeiter,cn=users,ou=NoSchool,dc=uni,dc=dtr',
> old_dn=None) (source_uid:TESTID record_uid: Reelef.Münch): {'school': ['The
> school "NoSchool" does not exist. Please choose an existing one or create
> it.']}
All the tests you did seem wrong to me. You didn't create a OU in the lowercase version before. So this output only shows that if you import a user in a school which doesn't exists the user is not imported. What we want to know is are there errors importing or migrating users which have a school with another case as the original school existing in LDAP.
Comment 5 Florian Best univentionstaff 2017-09-27 17:27:26 CEST
So we also want to know what happens in the future if users were imported with wrong case.
Comment 6 Daniel Tröder univentionstaff 2017-09-28 11:12:31 CEST
That's right... OK - here is a problem now:

# cd /usr/share/ucs-school-import
# scripts/create_ou myschool
# scripts/ucs-school-testuser-import --nostart --staff 1 --verbose MYSCHOOL
# mv test_users_2017-09-28_11\:00\:49.csv test_users_new_import_MYSCHOOL.csv

# cat test_users_new_import_MYSCHOOL.csv 
"Schulen","Benutzertyp","Vorname","Nachname","Klassen","Beschreibung","Telefon","EMail"
"MYSCHOOL","staff","Wilmken","Westerfeld","","A staff.","+44-623-914314",""

# scripts/ucs-school-user-import --verbose --conffile configs/ucs-school-testuser-import.json --infile test_users_new_import_MYSCHOOL.csv

# univention-ldapsearch -LLL 'uid=wilmken.west' | grep -i myschool
dn: uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr
departmentNumber: MYSCHOOL
ucsschoolSchool: MYSCHOOL
homeDirectory: /home/MYSCHOOL/mitarbeiter/wilmken.west

# cat test_users_new_import_MYSCHOOL.csv | sed 's/MYSCHOOL/myschool/g' > test_users_new_import_myschool.csv

# scripts/ucs-school-user-import --verbose --conffile configs/ucs-school-testuser-import.json --infile test_users_new_import_myschool.csv

2017-09-28 11:08:31 INFO  mass_import.import_users:94  ------ Importing users... ------
2017-09-28 11:08:31 INFO  user_import.read_input:75  ------ Starting to read users from input data... ------
2017-09-28 11:08:31 DEBUG base_reader.next:73  Input 2: ['myschool', 'staff', 'Wilmken', 'Westerfeld', '', 'A staff.', '+44-623-914314', ''] -> {u'Schulen': u'myschool', u'Benutzertyp': u'staff', u'Vorname': u'Wilmken', u'Telefon': u'+44-623-914314', u'Beschreibung': u'A staff.', u'Nachname': u'Westerfeld', u'Klassen': u'', u'EMail': u''}
2017-09-28 11:08:31 DEBUG csv_reader.map:191  ImportStaff(name=None, school=None, dn=None) attributes={'record_uid': None, 'disabled': None, 'objectType': 'users/user', 'old_user': None, 'display_name': u'Wilmken Westerfeld', 'source_uid': None, 'type_name': 'Staff', 'in_hook': False, 'udm_properties': {u'phone': [u'+44-623-914314'], u'description': u'A staff.', u'mailPrimaryAddress': u''}, 'type': 'importStaff', 'email': None, '$dn$': None, 'firstname': u'Wilmken', 'lastname': u'Westerfeld', 'entry_count': 0, 'schools': u'myschool', 'password': None, 'school': None, 'name': None, 'roles': ['staff'], 'school_classes': {}, 'input_data': [], 'birthday': None, 'action': None} udm_properties={u'phone': [u'+44-623-914314'], u'description': u'A staff.', u'mailPrimaryAddress': u''} action=None
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_classes:83  Searching for hooks in: /usr/share/ucs-school-import/pyhooks...
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_classes:91  Found hook classes: 
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_objects:124  Loaded hooks: {}.
2017-09-28 11:08:31 INFO  user_import.read_input:79  Done reading 1. user: ImportStaff(name=None, school=None, dn=None)
2017-09-28 11:08:31 INFO  user_import.read_input:87  ------ Read 1 users from input data. ------
2017-09-28 11:08:31 INFO  user_import.detect_users_to_delete:215  ------ Detecting which users to delete... ------
2017-09-28 11:08:31 DEBUG user_import.detect_users_to_delete:246  users_to_delete=[]
2017-09-28 11:08:31 INFO  user_import.delete_users:261  ------ Deleting 0 users... ------
2017-09-28 11:08:31 INFO  user_import.delete_users:296  ------ Deleted 0 users. ------
2017-09-28 11:08:31 INFO  user_import.create_and_modify_users:101  ------ Creating / modifying users... ------
2017-09-28 11:08:31 DEBUG user_import.create_and_modify_users:118  Creating / modifying user 1/1 ImportStaff(name=None, school=None, dn=None)...
2017-09-28 11:08:31 DEBUG base.get_only_udm_obj:869  Getting ImportStaff UDM object by filter: (&(objectClass=ucsschoolType)(ucsschoolSourceUID=TESTID)(ucsschoolRecordUID=Wilmken.Westerfeld))
2017-09-28 11:08:31 DEBUG username_handler.__init__:277  EmailHandler(max_length=254, dry_run=False) storage_backend='LdapStorageBackend'
2017-09-28 11:08:31 INFO  user_import.create_and_modify_users:133  Modifying ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr') (source_uid:TESTID record_uid:Wilmken.Westerfeld) attributes={'record_uid': u'Wilmken.Westerfeld', 'disabled': 'none', 'objectType': 'users/user', 'old_user': ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr'), 'display_name': 'Wilmken Westerfeld', 'source_uid': u'TESTID', 'type_name': 'Staff', 'in_hook': False, 'udm_properties': {u'phone': [u'+44-623-914314'], u'description': u'A staff.'}, 'type': 'importStaff', 'email': 'wilmken.westerfeld@example.com', '$dn$': 'uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr', 'firstname': 'Wilmken', 'lastname': 'Westerfeld', 'entry_count': 2L, 'schools': ['myschool'], 'password': None, 'school': 'myschool', 'name': 'wilmken.west', 'roles': ['staff'], 'school_classes': {}, 'input_data': ['myschool', 'staff', 'Wilmken', 'Westerfeld', '', 'A staff.', '+44-623-914314', ''], 'birthday': None, 'action': 'M'} udm_properties={u'phone': [u'+44-623-914314'], u'description': u'A staff.'}...
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_classes:83  Searching for hooks in: /usr/share/ucs-school-import/pyhooks...
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_classes:91  Found hook classes: 
2017-09-28 11:08:31 INFO  pyhooks_loader.get_hook_objects:124  Loaded hooks: {}.
2017-09-28 11:08:31 DEBUG base.call_hooks:373  /usr/share/ucs-school-import/hooks/user_modify_pre.d not found or empty.
2017-09-28 11:08:31 DEBUG import_user.modify_without_hooks:597  No school_classes are set, not modifying existing ones.
2017-09-28 11:08:31 INFO  base.modify_without_hooks:487  Modifying ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr')
2017-09-28 11:08:31 DEBUG base.cache:210  Initializing ('School', ('name', 'myschool'))
2017-09-28 11:08:31 DEBUG base.get_udm_object:666  Getting School UDM object by dn: ou=myschool,dc=uni,dc=dtr
2017-09-28 11:08:31 DEBUG base.get_only_udm_obj:869  Getting ImportStaff UDM object by filter: &(!(uid=wilmken.west))(mailPrimaryAddress=wilmken.westerfeld@example.com)
2017-09-28 11:08:31 DEBUG base.cache:210  Initializing ('MailDomain', ('name', 'example.com'))
2017-09-28 11:08:31 DEBUG base.get_udm_object:666  Getting MailDomain UDM object by dn: cn=example.com,cn=domain,cn=mail,dc=uni,dc=dtr
2017-09-28 11:08:31 INFO  user.do_modify:268  Removing ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr') from school 'MYSCHOOL'...
2017-09-28 11:08:31 WARNING user.remove_from_school:417  User ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr') not part of any school, removing it.
2017-09-28 11:08:31 DEBUG base.call_hooks:373  /usr/share/ucs-school-import/hooks/user_remove_pre.d not found or empty.
2017-09-28 11:08:31 INFO  base.remove_without_hooks:596  Deleting ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr')
2017-09-28 11:08:31 INFO  base.remove_without_hooks:603  ImportStaff(name='wilmken.west', school='myschool', dn=None) successfully removed
2017-09-28 11:08:31 DEBUG base.get_only_udm_obj:869  Getting ImportStaff UDM object by filter: (&(objectClass=ucsschoolType)(ucsschoolSourceUID=TESTID)(ucsschoolRecordUID=Wilmken.Westerfeld))
2017-09-28 11:08:31 WARNING utils.stopped_notifier:316  Starting univention-directory-notifier
2017-09-28 11:08:31 INFO  utils._run:288  Starting univention-directory-notifier (via systemctl): univention-directory-notifier.service.

2017-09-28 11:08:31 INFO  utils.stopped_notifier:323  univention-directory-notifier started
2017-09-28 11:08:31 ERROR cmdline.main:137  Outer Exception catcher: noObject("No None with source_uid=u'TESTID' and record_uid=u'Wilmken.Westerfeld' found.",)
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 117, in main
    self.do_import()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 95, in do_import
    importer.mass_import()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/mass_import.py", line 70, in mass_import
    self.import_users()
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/mass_import.py", line 100, in import_users
    user_import.create_and_modify_users(imported_users)  # 90% - 100%
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/mass_import/user_import.py", line 151, in create_and_modify_users
    success = user.modify(lo=self.connection)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 592, in modify
    return super(ImportUser, self).modify(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 481, in modify
    success = self.modify_without_hooks(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 600, in modify_without_hooks
    return super(ImportUser, self).modify_without_hooks(lo, validate, move_if_necessary)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 504, in modify_without_hooks
    self.do_modify(udm_obj, lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 269, in do_modify
    if not self.remove_from_school(removed_school, lo):
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/user.py", line 418, in remove_from_school
    return self.remove(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 647, in remove
    return super(ImportUser, self).remove(lo)
  File "/usr/lib/pymodules/python2.7/ucsschool/lib/models/base.py", line 592, in remove
    self.call_hooks('post', 'remove')
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 140, in call_hooks
    user = self.get_by_import_id(self._lo, self.source_uid, self.record_uid)
  File "/usr/lib/pymodules/python2.7/ucsschool/importer/models/import_user.py", line 227, in get_by_import_id
    cls.config.get("user_role", "user"), source_uid, record_uid))
noObject: No None with source_uid=u'TESTID' and record_uid=u'Wilmken.Westerfeld' found.

--------------------------------------------------------------------

This is a problem:

2017-09-28 11:08:31 INFO  user.do_modify:268  Removing ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr') from school 'MYSCHOOL'...
2017-09-28 11:08:31 WARNING user.remove_from_school:417  User ImportStaff(name='wilmken.west', school='myschool', dn='uid=wilmken.west,cn=mitarbeiter,cn=users,ou=myschool,dc=uni,dc=dtr') not part of any school, removing it.
Comment 7 Daniel Tröder univentionstaff 2017-09-28 11:22:45 CEST
{user.dn for user in User.get_all(lo, 'schuleeinz')} == {user.dn for user in User.get_all(lo, 'ScHuLeEiNz')}
2017-09-28 11:21:03 DEBUG base.get_all:737  Getting all User of schuleeinz with filter ''
2017-09-28 11:21:03 DEBUG base.get_all:737  Getting all User of ScHuLeEiNz with filter ''
→ True
Comment 8 Daniel Tröder univentionstaff 2017-09-28 11:28:58 CEST
In [30]: School('MyScHoOl').get_udm_object(lo).dn
2017-09-28 11:25:52 DEBUG base.get_udm_object:666  Getting School UDM object by dn: ou=MyScHoOl,dc=uni,dc=dtr
Out[30]: 'ou=myschool,dc=uni,dc=dtr'

In [35]: School.from_dn('ou=MyScHoOl,dc=uni,dc=dtr', None, lo)
2017-09-28 11:27:49 DEBUG base.from_dn:852  Looking up School with dn 'ou=MyScHoOl,dc=uni,dc=dtr'
Out[35]: School(name='myschool', dn='ou=myschool,dc=uni,dc=dtr')


Seems DNs are compared case insensitive...
Comment 9 Daniel Tröder univentionstaff 2017-09-28 15:50:21 CEST
We should see if the ucsschool libs School (and SchoolClass?) model should not also check if supplied OUs are OK.

But for this bug it is sufficient for the import code to verify the input data:

a412ed5c..65d887cd
* check school and schools attributes before add/mod/move
* add a ucs-test: 90_ucsschool/221_import-users_ou_case

ucs-school-import  15.0.0-48A~4.2.0.201709281545
ucs-test-ucsschool  4.0.4-29A~4.2.0.201709281547
Comment 10 Florian Best univentionstaff 2017-10-06 14:14:03 CEST
OK: create/modify/move are checking the case of the given school and deny import if case is different to the existing OU.
OK: YAML
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2017-10-16 21:32:07 CEST
UCS@school 4.2 v4 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.2v4-de.html

If this error occurs again, please clone this bug.