Bug 56064 - update_check_required_ucsschool_version block release update when python3-univention-appcenter is not installed
update_check_required_ucsschool_version block release update when python3-uni...
Status: NEW
Product: UCS
Classification: Unclassified
Component: Update - Release updates
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on: 54883 54896
Blocks:
  Show dependency treegraph
 
Reported: 2023-05-14 06:16 CEST by Philipp Hahn
Modified: 2023-05-14 06:17 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): UCS Performance
Max CVSS v3 score:
hahn: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2023-05-14 06:16:31 CEST
> Checking required_ucsschool_version ...           Traceback (most recent call last):
>   File "<string>", line 4, in <module>
> ModuleNotFoundError: No module named 'univention.appcenter'
> FAIL

```diff
--- base/univention-updater/script/check.sh
--- base/univention-updater/script/check.sh
@@@ -341,16 +341,15 @@@
 update_check_required_ucsschool_version () {  # Bug #54883 Bug #54896
-	if ! python3 -c '
+	python3 -c '
 import sys
 from distutils.version import LooseVersion
-from univention.appcenter.app_cache import Apps
+try:
+	from univention.appcenter.app_cache import Apps
+except ImportError:
+	sys.exit(0)
 ucsschool = Apps().find("ucsschool")
 
-if ucsschool.is_installed():
-	sys.exit(LooseVersion(ucsschool.version) <= LooseVersion("5.0 v1"))
-	'; then
-		echo "UCS@school is installed. To upgrade to UCS 5.0-2 as least UCS@school 5.0 v2 is required."
-		echo "Please upgrade the UCS@school app first!"
-		return 1
-	fi
+if ucsschool.is_installed() and LooseVersion(ucsschool.version) < LooseVersion("5.0 v2"):
+	print("UCS@school is installed. To upgrade to UCS 5.0-2 as least UCS@school 5.0 v2 is required.")
+	print("Please upgrade the UCS@school app first!")
+	sys.exit(1)
 }
```
Comment 1 Philipp Hahn univentionstaff 2023-05-14 06:17:30 CEST
(In reply to Philipp Hahn from comment #0)
> +	sys.exit(1)

Missing one ' there ate the end.