Bug 54755 - Add pyhook support to computer import script
Add pyhook support to computer import script
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 5.0
Other Linux
: P5 normal (vote)
: UCS@school 5.0 v2
Assigned To: Tobias Wenzel
Felix Botner
Depends on:
  Show dependency treegraph
Reported: 2022-05-13 11:46 CEST by Tobias Wenzel
Modified: 2023-05-26 11:51 CEST (History)
3 users (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): API change
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Wenzel univentionstaff 2022-05-13 11:46:25 CEST
* The scripts `import_{computer,group,inventory_number,networks,printer,router}` and `rename_class` execute shell hooks in 4.4.
* In 5.0 we will remove the support for that.
* We need those hooks for at least `import_computer`

- migrate import computers from UDM calls to ucs school lib
- create tests
- remove shell hook support from the other scripts
- extract import computers from the big script

Out of Scope:
the other import scripts
Comment 2 Daniel Tröder univentionstaff 2022-05-13 15:22:14 CEST
To make sure there are no misunderstandings: The "import_computers" script will receive only Python-hooks support.
There is and there will be no software in UCS@school 5.0 with shell hook support.
Comment 3 Tobias Wenzel univentionstaff 2022-05-31 09:31:11 CEST
This was implemented & reviewed in the gitlab issue + MR. The changes include:

- UCS@school Python hooks can now be executed during the computer_import.
- The test was adapted to executed python hooks (instead of shell hooks).

- Shell hook support was removed of the import scripts as it is deprecated.
- The code for executing it was removed from the ucsschool-lib.
- The mentions of shell hook support were removed of the documentation.
- Tests for shell hooks were removed.
- The release notes for 5.0 were adapted.

As discussed, the changes were merged to 5.0 

[5.0] 43d9b07ae Bug #54755: advisories
[5.0] 2060fa26d Bug #54755: advisories
[5.0] 7141e8df0 Bug #54755: changelogs
[5.0] 341d6e0af Bug #54755: Merge branch 'twenzel/5.0/54755_add_pyhook_support_to_computer_import_script' into 5.0
[5.0] 07cb1d001 Bug #54755: remove depr. zone in import
[5.0] 544d8bf2a Bug #54755: adapt tests & remove tests for shell hooks
[5.0] 6fac940cc Bug #54755: remove shell hook support from ucs-school-import
[5.0] fd764ff38 Bug #54755: replace verify school ou call
[5.0] f3981a987 Bug #54755: move import_computer to separate file
[5.0] cbec8fdc4 Bug #54755: remove tests for memberserver as they are not supported
[5.0] f3b44f934 Bug #54755: migrate UDM calls to UCS@school lib calls

and built with

Package: ucs-school-import
Version: 18.0.16A~
Branch: ucs_5.0-0
Scope: ucs-school-5.0

Package: ucs-test-ucsschool
Version: 7.3.44A~
Branch: ucs_5.0-0
Scope: ucs-school-5.0

Package: ucs-school-lib
Version: 13.0.17A~
Branch: ucs_5.0-0
Scope: ucs-school-5.0
Comment 4 Felix Botner univentionstaff 2022-06-08 08:42:11 CEST
OK - yaml
OK - packages
OK - documentation
OK - jenkins tests
Comment 5 Florian Best univentionstaff 2022-06-08 09:13:56 CEST
Mabye this fixed one of Bug #14722 Bug #15021 Bug #23501 Bug #54475 Bug #54771.
Comment 6 Florian Best univentionstaff 2022-06-08 09:17:05 CEST
FYI: there is still `/usr/share/ucs-school-import/scripts/create_dc` to create computer (slave) objects via the legacy import. See also Bug #46766.
Comment 7 Tobias Wenzel univentionstaff 2022-06-22 17:00:40 CEST
(In reply to Florian Best from comment #5)
> Mabye this fixed one of Bug #14722 Bug #15021 Bug #23501 Bug #54475 Bug
> #54771.

Bug 15021 - Rechner-Import ohne IP-Adresse nicht möglich
-> I did not test this, but I don't think this is fixed.

Bug 23501 - Import von mehreren MAC-Adressen
-> so far only one mac + ip address is possible.

Bug 54475 - import_computer fails with traceback
-> I have not tested this explicitly, but yes, this should be fixed.

Bug 54771 - change print to proper logging in import_computer
-> not fixed
Comment 8 Tobias Wenzel univentionstaff 2022-07-15 08:31:09 CEST
UCS@school 5.0 v2 has been released.


If this error occurs again, please clone this bug.