Bug 41914 - Class groups of "secondary schools" are created in wrong container
Class groups of "secondary schools" are created in wrong container
Status: CLOSED WORKSFORME
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
Florian Best
: interim-1
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-04 15:14 CEST by Sönke Schwardt-Krummrich
Modified: 2016-11-10 16:03 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 4: Will affect most installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.343
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 Sönke Schwardt-Krummrich univentionstaff 2016-08-04 15:14:14 CEST
The following user in member in school 'f6xbe73h03p' and 'to4o'. "Primary" school is 'f6xbe73h03p'.

If classes are specified for both schools, the school class objects of the "secondary" school 'to4o' are created in wrong container and only as "Group" instead of "SchoolGroup".
→ 'school_classes': {'to4o': ['to4o-5i', 'to4o-7k'], 'f6xbe73h03p': ['f6xbe73h03p-0l']}

→ wrong: Creating Group(name='to4o-7k', school='f6xbe73h03p', dn='cn=to4o-7k,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
→ should be SchoolClass(name='to4o-7k', school='f6xbe73h03p', dn='cn=to4o-7k,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')

→ wrong: Creating Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-5i,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
→ should be: Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-5i,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')

→ correct: Creating SchoolClass(name='f6xbe73h03p-0l', school='f6xbe73h03p', dn='cn=f6xbe73h03p-0l,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')

2016-07-27 17:36:06 DEBUG base.get_only_udm_obj:853  Getting ImportStudent UDM object by filter: (&(objectClass=ucsschoolType)(ucsschoolSourceUID=sourceUID-4yv367trv3)(ucsschoolRecordUID=vqbyho57gb;be5l2sweyg;jrjis1uj6s@nstx.local))
2016-07-27 17:36:06 INFO  user_import.create_and_modify_users:128  Adding ImportStudent(name='v.be5l2sweyg', school='f6xbe73h03p', dn='uid=v.be5l2sweyg,cn=schueler,cn=users,ou=f6xbe73h03p,dc=nstx,dc=local', old_dn=None) (source_uid:sourceUID-4yv367trv3 record_uid:vqbyho57gb;be5l2sweyg;jrjis1uj6s@nstx.local) attributes={'$dn$': 'uid=v.be5l2sweyg,cn=schueler,cn=users,ou=f6xbe73h03p,dc=nstx,dc=local', 'display_name': 'vqbyho57gb be5l2sweyg', 'record_uid': u'vqbyho57gb;be5l2sweyg;jrjis1uj6s@nstx.local', 'firstname': 'vqbyho57gb', 'lastname': 'be5l2sweyg', 'type_name': 'Student', 'school': 'f6xbe73h03p', 'name': 'v.be5l2sweyg', 'disabled': 'none', 'email': u'jrjis1uj6s@nstx.local', 'birthday': None, 'type': 'importStudent', 'schools': ['f6xbe73h03p', 'to4o'], 'password': 'xxxxxxxxxx', 'source_uid': u'sourceUID-4yv367trv3', 'school_classes': {'to4o': ['to4o-5i', 'to4o-7k'], 'f6xbe73h03p': ['f6xbe73h03p-0l']}, 'objectType': 'users/user'} udm_properties={'overridePWHistory': '1', u'description': u'', 'overridePWLength': '1'}...
2016-07-27 17:36:06 DEBUG base.call_hooks:363  /usr/share/ucs-school-import/hooks/user_create_pre.d not found or empty.
2016-07-27 17:36:06 DEBUG base.get_only_udm_obj:853  Getting ImportStudent UDM object by filter: username=v.be5l2sweyg
2016-07-27 17:36:06 INFO  base.create_without_hooks:425  Creating ImportStudent(name='v.be5l2sweyg', school='f6xbe73h03p', dn='uid=v.be5l2sweyg,cn=schueler,cn=users,ou=f6xbe73h03p,dc=nstx,dc=local', old_dn=None)
2016-07-27 17:36:06 DEBUG base.cache:209  Initializing ('School', ('name', 'f6xbe73h03p'))
2016-07-27 17:36:06 DEBUG base.get_udm_object:650  Getting School UDM object by dn: ou=f6xbe73h03p,dc=nstx,dc=local
2016-07-27 17:36:06 DEBUG base.get_only_udm_obj:853  Getting ImportStudent UDM object by filter: &(!(uid=v.be5l2sweyg))(mailPrimaryAddress=jrjis1uj6s@nstx.local)
2016-07-27 17:36:06 DEBUG base.cache:209  Initializing ('MailDomain', ('name', u'nstx.local'))
2016-07-27 17:36:06 DEBUG base.get_udm_object:650  Getting MailDomain UDM object by dn: cn=nstx.local,cn=domain,cn=mail,dc=nstx,dc=local
2016-07-27 17:36:06 DEBUG base.cache:209  Initializing ('Group', ('name', 'Domain Users f6xbe73h03p'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:06 DEBUG base.call_hooks:363  /usr/share/ucs-school-import/hooks/group_create_pre.d not found or empty.
2016-07-27 17:36:06 DEBUG base.get_only_udm_obj:853  Getting Group UDM object by filter: name=Domain Users f6xbe73h03p
2016-07-27 17:36:06 DEBUG base.cache:209  Initializing ('Group', ('name', 'schueler-f6xbe73h03p'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:06 DEBUG base.cache:209  Initializing ('Group', ('name', 'to4o-5i'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:06 DEBUG base.get_only_udm_obj:853  Getting Group UDM object by filter: name=to4o-5i
2016-07-27 17:36:06 INFO  base.create_without_hooks:425  Creating Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-5i,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
2016-07-27 17:36:07 INFO  base.create_without_hooks:447  Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-5i,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local') successfully created
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('Group', ('name', 'Domain Users f6xbe73h03p'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('Group', ('name', 'to4o-5i'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('Group', ('name', 'schueler-f6xbe73h03p'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.call_hooks:363  /usr/share/ucs-school-import/hooks/group_create_post.d not found or empty.
2016-07-27 17:36:07 DEBUG base.cache:209  Initializing ('Group', ('name', 'to4o-7k'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.get_only_udm_obj:853  Getting Group UDM object by filter: name=to4o-7k
2016-07-27 17:36:07 INFO  base.create_without_hooks:425  Creating Group(name='to4o-7k', school='f6xbe73h03p', dn='cn=to4o-7k,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
2016-07-27 17:36:07 INFO  base.create_without_hooks:447  Group(name='to4o-7k', school='f6xbe73h03p', dn='cn=to4o-7k,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local') successfully created
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('Group', ('name', 'to4o-7k'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.get_only_udm_obj:853  Getting SchoolClass UDM object by filter: name=f6xbe73h03p-0l
2016-07-27 17:36:07 INFO  base.create_without_hooks:425  Creating SchoolClass(name='f6xbe73h03p-0l', school='f6xbe73h03p', dn='cn=f6xbe73h03p-0l,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
2016-07-27 17:36:07 INFO  base.create_without_hooks:447  SchoolClass(name='f6xbe73h03p-0l', school='f6xbe73h03p', dn='cn=f6xbe73h03p-0l,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local') successfully created
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('SchoolClass', ('name', 'f6xbe73h03p-0l'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('SchoolClass', ('name', 'to4o-5i'), ('school', 'to4o'))
2016-07-27 17:36:07 DEBUG base.invalidate_cache:230  Invalidating ('SchoolClass', ('name', 'to4o-7k'), ('school', 'to4o'))
2016-07-27 17:36:07 DEBUG base.get_only_udm_obj:853  Getting SchoolClass UDM object by filter: name=f6xbe73h03p-0l
2016-07-27 17:36:07 DEBUG base.get_udm_object:650  Getting ClassShare UDM object by dn: cn=f6xbe73h03p-0l,cn=klassen,cn=shares,ou=f6xbe73h03p,dc=nstx,dc=local
2016-07-27 17:36:07 DEBUG base.call_hooks:363  /usr/share/ucs-school-import/hooks/share_create_pre.d not found or empty.
2016-07-27 17:36:07 INFO  base.create_without_hooks:425  Creating ClassShare(name='f6xbe73h03p-0l', school='f6xbe73h03p', dn='cn=f6xbe73h03p-0l,cn=klassen,cn=shares,ou=f6xbe73h03p,dc=nstx,dc=local')
2016-07-27 17:36:07 DEBUG base.from_dn:836  Looking up School with dn 'ou=f6xbe73h03p,dc=nstx,dc=local'
2016-07-27 17:36:07 INFO  share.do_create:66  Creating share on "dcf6xbe73h03p-01.nstx.local"
2016-07-27 17:36:07 INFO  base.create_without_hooks:447  ClassShare(name='f6xbe73h03p-0l', school='f6xbe73h03p', dn='cn=f6xbe73h03p-0l,cn=klassen,cn=shares,ou=f6xbe73h03p,dc=nstx,dc=local') successfully created
2016-07-27 17:36:07 DEBUG base.call_hooks:363  /usr/share/ucs-school-import/hooks/share_create_post.d not found or empty.
2016-07-27 17:36:07 DEBUG base.cache:209  Initializing ('Group', ('name', 'schueler-f6xbe73h03p'), ('school', 'f6xbe73h03p'))
2016-07-27 17:36:07 DEBUG base.get_only_udm_obj:853  Getting Group UDM object by filter: name=schueler-f6xbe73h03p
2016-07-27 17:36:07 DEBUG base.from_dn:836  Looking up School with dn 'ou=f6xbe73h03p,dc=nstx,dc=local'
2016-07-27 17:36:07 DEBUG base.get_all:721  Getting all AnyComputer of f6xbe73h03p with filter 'univentionService=Windows Profile Server'
2016-07-27 17:36:07 WARNING utils.stopped_notifier:190  Starting univention-directory-notifier
2016-07-27 17:36:08 INFO  utils._run:162  Starting Univention Directory Notifier daemon.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2016-08-04 15:27:17 CEST
> → wrong: Creating Group(name='to4o-7k', school='f6xbe73h03p', 
> dn='cn=to4o-7k,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
> → should be SchoolClass(name='to4o-7k', school='f6xbe73h03p', dn='cn=to4o-
> 7k,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')

wrong, should be SchoolClass(name='to4o-7k', school='to4o', 
dn='cn=to4o-7k,cn=klassen,cn=schueler,cn=groups,ou=to4o,dc=nstx,dc=local')

> → wrong: Creating Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-
> 5i,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')
> → should be: Group(name='to4o-5i', school='f6xbe73h03p', dn='cn=to4o-
> 5i,cn=klassen,cn=schueler,cn=groups,ou=f6xbe73h03p,dc=nstx,dc=local')

wrong: should be SchoolClass(name='to4o-5i', school='to4o', 
dn='cn=to4o-5i,cn=klassen,cn=schueler,cn=groups,ou=to4o,dc=nstx,dc=local')
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2016-08-04 15:39:26 CEST
A comment with bugnumber has been added to ucs-test script 
34_import-users_via_cli_v2 to trigger the bug.
Comment 3 Florian Best univentionstaff 2016-08-15 12:29:28 CEST
afaics caused by svn r71418 / Bug #41907.
Comment 4 Daniel Tröder univentionstaff 2016-09-22 15:56:08 CEST
This is fixed in unreleased errate scope. Don't know by which bug.
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2016-09-22 16:44:44 CEST
@QA: Please change to DUPLICATE of Bug #41907 if this is correct.
Comment 6 Florian Best univentionstaff 2016-09-27 14:41:56 CEST
OK: I have no idea how to reproduce, the test case ofc fails without the patch of Bug #41907.

ucs-test-ucsschool (3.0.16-14):
r72840 | Bug #41914: reenable correct test case behavior