1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00

Fix issue if there are no service description

This commit is contained in:
Josué Tille 2024-04-16 23:20:53 +02:00
parent 51e3082696
commit 0c860e797f
No known key found for this signature in database
GPG key ID: 5F259226AD51F2F5

View file

@ -125,7 +125,7 @@ import yaml, socket
hard_coded_ports = ["25", "53", "80", "443", "587", "993"] hard_coded_ports = ["25", "53", "80", "443", "587", "993"]
with open("/etc/yunohost/services.yml", "r") as f: with open("/etc/yunohost/services.yml", "r") as f:
services = yaml.safe_load(f) services = yaml.safe_load(f)
results = ["%s|%s" % (k, v["description"]) for k, v in services.items()] results = ["%s|%s" % (k, v["description"] if "description" in v else k) for k, v in services.items()]
print('\n'.join(results)) print('\n'.join(results))
EOF EOF
)" )"