The hook `ext_config_dep_on_role.py` does not support the role `teacher_and_staff`. As we support importing that role generally, this hook should also work with this role. The test `90_ucsschool/246_import_user_config_pyhook.py` fails while loading the configuration, but passes anyway: ``` 2024-04-03 15:33:19 INFO import_pyhook.call_hooks:165 Running ImportPyHookLoader post_config_files_read hook <bound method ExtendConfigByRole.post_config_files_read of <test246_config_modification.ExtendConfigByRole object at 0x7f598426a780>> ... 2024-04-03 15:33:19 ERROR test246_config_modification.preconditions_met:127 Exiting hook: unknown role 'teacher_and_staff'. ``` We need to add `teacher_and_staff` to the supported roles of the hook and review/rework the test.
Informations from another ticket and rocketchat to solve this issue: This is the diff for the file in the pyhooks-available folder: diff --git a/ucs-school-import/usr/share/ucs-school-import/pyhooks-available/ext_config_dep_on_role.py b/ucs-school-import/usr/share/ucs-school-import/pyhooks-available/ext_config_dep_on_role.py index 43ecf14e4..aa58d7378 100644 --- a/ucs-school-import/usr/share/ucs-school-import/pyhooks-available/ext_config_dep_on_role.py +++ b/ucs-school-import/usr/share/ucs-school-import/pyhooks-available/ext_config_dep_on_role.py @@ -123,7 +123,7 @@ class ExtendConfigByRole(ConfigPyHook): if config.get("user_role") is None: self.logger.error('Exiting hook: hook requires a fixed role but "user_role" is None.') return False - if config["user_role"] not in list(supported_roles) + ["student"]: + if config["user_role"] not in list(supported_roles) + ["student", "teacher_and_staff"]: self.logger.error("Exiting hook: unknown role %r.", config["user_role"]) return False if config["user_role"] not in config["include"]["by_role"]: But apply this to the file in /usr/share/ucs-school-import/pyhooks/, not in /usr/share/ucs-school-import/pyhooks-available/. or udm users/user modify \ --dn uid='testlehrer,cn=lehrer,cn=users,ou=GrundschuleUnivention,dc=school,dc=intranet' \ --append-option=ucsschoolStaff \ --append ucsschoolRole=staff:school:GrundschuleUnivention \ --append groups='cn=mitarbeiter-GrundschuleUnivention,cn=groups,ou=GrundschuleUnivention,dc=school,dc=intranet' udm users/user move \ --dn uid='testlehrer,cn=lehrer,cn=users,ou=GrundschuleUnivention,dc=school,dc=intranet' \ --position 'cn=lehrer und mitarbeiter,cn=users,ou=GrundschuleUnivention,dc=school,dc=intranet'
Fixed with Package: ucs-school-import Version: 18.0.48 Branch: 5.0-0 Scope: ucs-school-5.0
Errata updates for UCS@school 5.0 v5 have been released. https://docs.software-univention.de/ucsschool-changelog/5.0v5/en/changelog.html https://docs.software-univention.de/ucsschool-changelog/5.0v5/de/changelog.html If this error occurs again, please clone this bug.