services.py: drop legacy hack for glances

This commit is contained in:
Alexandre Aubin 2021-09-21 16:09:06 +02:00
parent 9bcb7e0b9e
commit a6c72566a5

View file

@ -125,16 +125,6 @@ def regen_conf(
if not names:
names = hook_list("conf_regen", list_by="name", show_info=False)["hooks"]
# Dirty hack for legacy code : avoid attempting to regen the conf for
# glances because it got removed ... This is only needed *once*
# during the upgrade from 3.7 to 3.8 because Yunohost will attempt to
# regen glance's conf *before* it gets automatically removed from
# services.yml (which will happens only during the regen-conf of
# 'yunohost', so at the very end of the regen-conf cycle) Anyway,
# this can be safely removed once we're in >= 4.0
if "glances" in names:
names.remove("glances")
# [Optimization] We compute and feed the domain list to the conf regen
# hooks to avoid having to call "yunohost domain list" so many times which
# ends up in wasted time (about 3~5 seconds per call on a RPi2)
@ -451,10 +441,6 @@ def _save_regenconf_infos(infos):
categories -- A dict containing the regenconf infos
"""
# Ugly hack to get rid of legacy glances stuff
if "glances" in infos:
del infos["glances"]
try:
with open(REGEN_CONF_FILE, "w") as f:
yaml.safe_dump(infos, f, default_flow_style=False)