Bug 56201 - Replace python-notifier functionality in UMC
Replace python-notifier functionality in UMC
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-4-errata
Assigned To: Florian Best
Christian Castens
:
Depends on:
Blocks: 56264 56390
  Show dependency treegraph
 
Reported: 2023-06-27 10:50 CEST by Florian Best
Modified: 2023-08-02 16:06 CEST (History)
0 users

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): Cleanup
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2023-06-27 10:50:53 CEST
We still use the python-notifier thread functionality in our UMC server functionality. We can simply replace this with native threading.

There are also some UMC modules which uses notifier.threads directly. We should provide functionality in UMC, so that we can switch to that and we have the code under control.

python3-notifier will be removed in UCS 5.1.
Comment 1 Florian Best univentionstaff 2023-07-28 21:05:45 CEST
1. new threading functionality is provided by UMC Python API:
`univention.management.console.modules.decorators.SimpleThread()` replaces `notifier.threads.Simple()` and `notifier.threads.Callback()`.

`Simple('name', Callback(_thread, *args, *kwargs), Callback(_finished, *args, **kwargs)).run()`
can be replaced with
`SimpleThread('name', _thread, lambda t, r: _finished(t, r, *args, **kwargs)).run(*args, **kwargs)`

Various modules now use this.

2. occurences of `self.{username,password,user_dn,bind_user_connection}` in various UMC modules have been replaced with the equivalent in `request.…`.
a new prepare(request) method can be used to access to attributes when it's required in a init() function

3. unused functions in the appcenter module have been removed.

To be tested:
* System Setup: Save settings e.g. network settings
* System Setup: execute initial join/setup process
* System Setup: apply network settings in setup process
* Appcenter: install or uninstall app locally
* Appcenter: install or uninstall app remote
* Appcenter/Package Management: install or uninstall debian package
* Join module: run a joinscript
* Join module: make initial join
* Lib: reboot server via the menu entry
* UDM: LDAP directory tree: search objects in a container
* UDM: move a object or container
* Self service: set user profile data
* Admin diary: add a comment to any entry

univention-system-setup.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-system-setup (13.0.9-2)
dbd28d356a92 | chore: add advisory and changelog entries

univention-system-setup (13.0.9-1)
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API

univention-self-service.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-self-service (5.0.7-3)
dbd28d356a92 | chore: add advisory and changelog entries

univention-self-service (5.0.7-2)
cf5a4ecccfdd | refactor(umc): replace deprecated API with new UMC Python API

univention-management-console.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-udm.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-udm (10.0.8-4)
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-udm (10.0.8-3)
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API
cf5a4ecccfdd | refactor(umc): replace deprecated API with new UMC Python API

univention-management-console-module-lib.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-lib (9.0.4-2)
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-lib (9.0.4-1)
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API

univention-management-console-module-join.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-join (12.0.5-4)
dbd28d356a92 | chore: add advisory and changelog entries

univention-management-console-module-join (12.0.5-3)
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API

univention-management-console-frontend (4.1.104-1)
r56201 | Bug #36914: Adjusted index.html to show warning if IE <= 8 is used

univention-management-console (12.0.31-9)
cf5a4ecccfdd | refactor(umc): replace deprecated API with new UMC Python API
8eef08031b90 | feat(umc): offer SimpleThread as replacement for notifier.threads.Simple()
453a4abf662d | feat(umc): add thread callback for progress bars, with/without long polling requests

univention-management-console (12.0.31-10)
dbd28d356a92 | chore: add advisory and changelog entries

univention-appcenter.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-appcenter (9.0.8-3)
dbd28d356a92 | chore: add advisory and changelog entries

univention-appcenter (9.0.8-2)
02abd4bfd782 | refactor(appcenter): remove unused functions
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API
cf5a4ecccfdd | refactor(umc): replace deprecated API with new UMC Python API

univention-admin-diary.yaml
dbd28d356a92 | chore: add advisory and changelog entries

univention-admin-diary (2.0.7-2)
dbd28d356a92 | chore: add advisory and changelog entries

univention-admin-diary (2.0.7-1)
cf5a4ecccfdd | refactor(umc): replace deprecated API with new UMC Python API

ucs-test (10.0.15-15)
655260573c7e | refactor: replace notifier.threads with new SimpleThread UMC API
Comment 2 Christian Castens univentionstaff 2023-08-01 17:44:18 CEST
QA:


Environment: master + slave

OK * Appcenter: install or uninstall app locally
OK * Appcenter: install or uninstall app remote
OK * Appcenter/Package Management: install or uninstall debian package

OK * Join module: run a joinscript
OK * Join module: make initial join

OK * Lib: reboot server via the menu entry

OK * UDM: LDAP directory tree: search objects in a container
OK * UDM: move a object or container

OK * Self service: set user profile data

OK * Admin diary: add a comment to any entry


OK * No tracebacks in logfiles
OK * Advisories


yet to be tested:
* System Setup: Save settings e.g. network settings
* System Setup: execute initial join/setup process
* System Setup: apply network settings in setup process
Comment 3 Christian Castens univentionstaff 2023-08-02 14:29:37 CEST
OK * System Setup: Save settings e.g. network settings
OK * System Setup: execute initial join/setup process
OK * System Setup: apply network settings in setup process