mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
services: fix a couple edge cases
This commit is contained in:
parent
ac47710584
commit
4571c5b22f
1 changed files with 2 additions and 2 deletions
|
@ -744,14 +744,14 @@ def _save_services(services):
|
||||||
diff = {}
|
diff = {}
|
||||||
|
|
||||||
for service_name, service_infos in services.items():
|
for service_name, service_infos in services.items():
|
||||||
service_conf_base = conf_base.get(service_name, {})
|
service_conf_base = conf_base.get(service_name, {}) or {}
|
||||||
diff[service_name] = {}
|
diff[service_name] = {}
|
||||||
|
|
||||||
for key, value in service_infos.items():
|
for key, value in service_infos.items():
|
||||||
if service_conf_base.get(key) != value:
|
if service_conf_base.get(key) != value:
|
||||||
diff[service_name][key] = value
|
diff[service_name][key] = value
|
||||||
|
|
||||||
diff = {name: infos for name, infos in diff.items() if infos}
|
diff = {name: infos for name, infos in diff.items() if infos or name not in conf_base}
|
||||||
|
|
||||||
write_to_yaml(SERVICES_CONF, diff)
|
write_to_yaml(SERVICES_CONF, diff)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue