Univention Bugzilla – Bug 50415
every modules.update() calls import_{syntax,hook}_files() and UCS@school makes modules.update() in a hook
Last modified: 2019-10-25 17:33:26 CEST
univention.admin.modules.update() calls: * univention.admin.syntax.import_syntax_files() * univention.admin.hook.import_hook_files() modules.update() is called during import in: virtualization/univention-virtual-machine-manager-daemon/src/univention/uvmm/uvmm_ldap.py:univention.admin.modules.update() virtualization/univention-virtual-machine-manager-daemon/umc/python/uvmm/profiles.py:univention.admin.modules.update() and in UCS@school: ucs-school-lib/python/models/__init__.py:udm_modules.update() ucs-school-lib/python/models/school.py: univention.admin.modules.update() ucs-school-lib/python/roleshares.py:udm_modules.update() ucs-school-lib/python/schoolldap.py:udm_modules.update() When having UCS@school and UVMM and some other things installed there are a lot of syntaxes/hooks: # ls /usr/share/pyshared/univention/admin/hooks.d/ office365_userPrincipalName_hook.py schoolAdminGroup.py schoolOU.py ucsschool_purge_timestamp.py ucsschool_role_computers.py ucsschool_user_options.py # ls /usr/share/pyshared/univention/admin/syntax.d/ app_syntax.py office365.py samlserviceprovider.py syntax.ucs-school-import.py univention-virtual-machine-manager-schema.py The hook /usr/share/pyshared/univention/admin/hooks.d/ucsschool_role_computers.py import "ucsschool.lib.models": This then calls univention.admin.modules() again. So the syntax files are loaded twice during: python -c "import univention.admin.modules; univention.admin.modules.update()". This slows down the import. We should enhance the situation! I don't find the bug anymore but I once already suggested to call modules.update() in univention/admin/__init__.py and remove all update() calls in other scripts/libs and let UDM handle all things itself. See also Bug #49923.