Bug 49264 - [4.3] create import hook to modify configuration
[4.3] create import hook to modify configuration
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.3
Other Linux
: P5 normal (vote)
: UCS@school 4.3 v8-errata
Assigned To: Daniel Tröder
Jürn Brodersen
:
Depends on:
Blocks: 49265 49266
  Show dependency treegraph
 
Reported: 2019-04-09 13:12 CEST by Daniel Tröder
Modified: 2023-03-25 06:51 CET (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
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 Daniel Tröder univentionstaff 2019-04-09 13:12:01 CEST
When importing through the HTTP-API, it is not possible to choose from different configurations (like with the "-c" switch on the command line).

Create a hook to manipulate the configuration after reading the configuration files and applying the command line arguments.
Comment 1 Daniel Tröder univentionstaff 2019-04-09 16:08:33 CEST
A hook was added that allows to modify the configuration after reading the configuration files and applying the command line arguments. The base class is ucsschool.importer.utils.config_pyhook.ConfigPyHook.

[4.3] 148ce6a3a Bug #49264: improve documentation
[4.3] f60d7f225 Bug #49264: name function more aptly
[4.3] c5540268c Bug #49264: cleanup noop code (attributes contain lazy object)
[4.3] f13e2c42e Bug #49264: prevent circular dependency
[4.3] 61d7e6a7a Bug #49264: create configuration hook
[4.3] 0186c7c1a Bug #49264, Bug #49266: test configuration hook
[4.3] 2680b2fd9 Bug #49264, Bug #49266: changelog
[4.3] 62b233ee7 Bug #49264, Bug #49266, Bug #49268: advisory updates

ucs-school-import (16.0.3-9)
Comment 2 Jürn Brodersen univentionstaff 2019-04-10 14:49:47 CEST
What I tested (using the http api):
Added a hook and imported -> OK
Added additional a config hook and imported -> OK (different configs are used)
246_import_user_config_pyhook -> OK

YAML -> OK