1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

appsv2: don't miserably crash when failing to convert port number because of syntaxes such as $port+1

This commit is contained in:
Alexandre Aubin 2023-03-13 17:39:32 +01:00
parent d0da3de4cb
commit ed9a2c010f

View file

@ -180,6 +180,10 @@ def _convert_v1_manifest_to_v2(app_path):
if name == "port":
name = "main"
if not default.isdigit():
print(f"Failed to parse '{default}' as a port number ... Will use 12345 instead")
default = 12345
manifest["resources"]["ports"][f"{name}.default"] = int(default)
if exposed:
manifest["resources"]["ports"][f"{name}.exposed"] = exposed