Bug 49268 - [4.3] unify pyhook loading code
[4.3] unify pyhook loading code
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: 48021 48188 48189 48958
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-09 14:23 CEST by Daniel Tröder
Modified: 2023-03-25 06:42 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
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 14:23:39 CEST
Backport to 4.3.

+++ This bug was initially created as a clone of Bug #48958 +++

The UCS@school code loads different subclassses of PyHook with duplicate loading and caching code in multiple Python modules.

Refactor to use a common function for all PyHook users.
Comment 1 Daniel Tröder univentionstaff 2019-04-09 15:30:08 CEST
Merged commits from 4.4 into 4.3:

[4.3] b46ad27fe Bug #49268: fix wrong formatting
[4.3] 89adf9be8 Bug #49268: add convenience wrapper for easy usage of PyHooksLoader
[4.3] 72e236390 Bug #49268: use new ImportPyHookLoader convenience functions
[4.3] 48523accb Bug #49268: improve type hints and py3 compatibility
[4.3] 4d46651b4 Bug #49268: honor dry-run when ImportUser class is used directly
[4.3] 029fd0a10 Bug #49268: advisories

QA:
* package builds will be done after merging Bug #49264 and Bug #49266
* running 90_ucsschool/2*hook* successfully should be enough as functional test.
Comment 3 Daniel Tröder univentionstaff 2019-04-10 10:31:14 CEST
Missed backporting ucs-test code from Bug #48189.

[4.3] 526ff143c Bug #49268: check for preexisting hooks
[4.3] 49b977071 Bug #49268: adapt tests to check_for_non_empty_pyhooks

ucs-test-ucsschool (5.0.4-11)
Comment 4 Jürn Brodersen univentionstaff 2019-04-10 14:49:36 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