Univention Bugzilla – Bug 47448
Create interface for custom configuration checks
Last modified: 2018-09-11 11:34:18 CEST
When creating derivative works of the UCS@school import, specific configuration requirements may have to be met. If checking for a correct configuration can only be done in hooks or derived classes, then the exceptions can only be raised after starting an import. Create an interface that allows adding custom configuration checks.
Depends on Bug #45715, because it requires the PyHooksLoader class with filtering support. [4.3] 999c96a57 Bug #47448: create interface for custom configuration checks [4.3] 141b424b8 Bug #47448: use new interface for default configuration checks [4.3] 84f5b7361 Bug #47448: require PyHooksLoader with filtering support [4.3] 2d0c32879 Bug #47448: add ucs-test for custom configuration check interface [4.3] 218f92760 Bug #47447 Bug #47448: changelog [4.3] e0d7a329b Bug #47447 Bug #47448: Merge branch 'dtroeder/SiSoMi.scenario' into 4.3 [4.3] d02743564 Bug #47447 Bug #47448: advisory ucs-school-import (16.0.2-30) ucs-test-ucsschool (5.0.2-75) Not yet resolved, because the import documentation must still be updated. The internal documentation is already online: https://billy.knut.univention.de/~dtroeder/http-api-doc/python/ucsschool.importer.utils.html#module-ucsschool.importer.utils.configuration_checks
A ucs-test was added: 238_import_user_custom_config_check.
Added a section to the official import documentation. 238_import_user_custom_config_check ran successfully in Jenkins. http://jenkins.knut.univention.de:8080/job/UCSschool-4.3/job/Handbook/6/artifact/webroot/ucsschool-import-handbuch-4.3.html#extending
Some small fixes have been comitted to the manual: 39a691816 Bug #47448: small fixes in ucsschool-import-handbuch-4.3.xml As expected, the import throws an error, if the check fails: Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 110, in main self.setup_config() File "/usr/lib/pymodules/python2.7/ucsschool/importer/frontend/cmdline.py", line 74, in setup_config self.config = setup_configuration(configs, **self.args.settings) File "/usr/lib/pymodules/python2.7/ucsschool/importer/configuration.py", line 47, in setup_configuration run_configuration_checks(config) File "/usr/lib/pymodules/python2.7/ucsschool/importer/utils/configuration_checks.py", line 110, in run_configuration_checks method() File "/usr/share/ucs-school-import/checks/test238_custom_conf_check.py", line 9, in test_forbidden_birthday raise InitialisationError('Thou shalt not import birthdays!') InitialisationError: Thou shalt not import birthdays! 2018-08-31 14:34:35 INFO: run_import:475: Import process exited with exit code 1 2018-08-31 14:34:35 ERROR: run_import:477: As requested raising an exception due to non-zero exit code OK: code change OK: functional change OK: tests (ucs-test is ok) OK: changelog entry OK: advisory OK: package built and installable
UCS@school 4.3 v5 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v5-de.html If this error occurs again, please clone this bug.