1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yunomonitor_ynh.git synced 2024-09-03 17:46:11 +02:00

Fix python code

This commit is contained in:
Salamandar 2024-01-19 16:44:13 +01:00
parent 2fca6c3e68
commit 6fea0a454f

View file

@ -68,11 +68,12 @@ ynh_script_progression --message="Adding a configuration file..."
python3 -c '
import sys
import yaml
print(yaml.dumps({
"mails": sys.argv[1].split(","),
"sms_apis": sys.argv[2].split(","),
"monitored_servers": sys.argv[3].split(","),
"monitoring_servers": sys.argv[4].split(","),
split_or_empty = lambda x: [] if x == "" else x.split(",")
print(yaml.dump({
"mails": split_or_empty(sys.argv[1]),
"sms_apis": split_or_empty(sys.argv[2]),
"monitored_servers": split_or_empty(sys.argv[3]),
"monitoring_servers": split_or_empty(sys.argv[4]),
}))
' "$mails" "$sms_api" "$monitored_servers" "$monitoring_servers" \
> "$install_dir/conf/$app.yml"