Bug 52195 - system diagnose module to check installation of ox-support package in ucsschool
system diagnose module to check installation of ox-support package in ucsschool
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v9
Assigned To: Toni Röhmeyer
Daniel Tröder
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-08 09:16 CEST by Daniel Tröder
Modified: 2021-03-25 08:12 CET (History)
2 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):
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 2020-10-08 09:16:40 CEST
Create a system diagnose module that is shipped with ucsschool that should check and fail on the following conditions:

1. running on DC master
2. OX ist installed somewhere in the domain (test for existence of "isOxUser" users/user UDM property)
3. the package "ucs-school-ox-support" is not installed

The "fix" button should install the package.
Comment 1 Toni Röhmeyer univentionstaff 2020-10-09 13:52:10 CEST
Added diagnostic module with commit

1fe859311 Bug #52195: added diagnostic module for checking ox support

on branch troehmey/bug52195_diagnostic_ox_support.


I tested the module by removing the package ucs-school-ox-support and then running the diagnostic module. 
Hitting the fix-button resolved the issue and the package status was then "install ok installed".
Comment 2 Toni Röhmeyer univentionstaff 2020-10-09 14:58:38 CEST
Added small fixup with commit f92ddaaed
Comment 3 Daniel Tröder univentionstaff 2020-11-20 15:08:25 CET
* remove unused imports ucr_get, ucr_is_true
* max line length is 105 chars
* "\n".join([_("")]) can be reduced to _("")
* The "description" is wrong:
  - The app is called "OX App Suite", most users don't know the app id "oxseforucs".
  - The app does not need to be installed on the dc master, it is enough that it is installed somewhere in the domain.
* where do the KeyErrors come from? I cannot reproduce them.
* Please add to the warning that OX is installed in the domain, but the package not etc.
Comment 4 Daniel Tröder univentionstaff 2020-11-20 15:14:04 CET
The copyright notice starts with 2019, but the script is from this year.
Comment 5 Toni Röhmeyer univentionstaff 2020-11-24 09:51:35 CET
Fixed issues mentioned in comment #3 and comment #4 with commit

[troehmey/bug52195_diagnostic_ox_support] Bug #52195: fixed descriptions, removed unnecessary import
Comment 6 Daniel Tröder univentionstaff 2020-11-25 15:53:14 CET
* Please make the module level description a module docstring.
* Unused import: "ucr".
* Unreachable "return" after a "raise".
* If a string is inside brackets and should be split, it is safer to make two strings out of it, that to use "\":
--------------------------------------------------
>>> print(
...   "foo "
...   "bar"
... )
foo bar
--------------------------------------------------

* The comment "app is not installed on DC master" is misleading. The if branch is taken if the app is not installed _anywhere_.
Comment 7 Toni Röhmeyer univentionstaff 2020-12-01 10:52:28 CET
Fixed issues mentioned in comment #6 with commit

da3cd30a2 Bug #52195: check if installed on dc-master
(sorry for the bad commit message...)
I would like to squash all commits when QA gives green light.

Until now the test was also missing the check if the test is running on DC Master
Comment 8 Daniel Tröder univentionstaff 2020-12-01 15:13:12 CET
OK: code review
OK: functionality (manual test: detection and installation of missing package)

Please squash, merge to 4.4, build, advisory.
Comment 9 Toni Röhmeyer univentionstaff 2020-12-01 16:46:26 CET
Feature branch merged to 4.4 with:

8b7b1cb71 Bug #52195: added yaml
de78b963d Bug #52195: added changelog entry
dfb8db599 Bug #52195: Merge branch 'troehmey/bug52195_diagnostic_ox_support' into 4.4


Successful build:

Package: ucs-school-umc-diagnostic
Version: 1.0.0-14A~4.4.0.202012011637
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 10 Daniel Tröder univentionstaff 2020-12-02 09:37:24 CET
OK: merge
OK: build
OK: advisory
Comment 11 Tobias Wenzel univentionstaff 2021-03-24 14:08:54 CET
UCS@school 4.4 v9 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v9-de.html

If this error occurs again, please clone this bug.