certificate: don't attempt to restart metronome if not installed

This commit is contained in:
Alexandre Aubin 2022-01-09 18:40:53 +01:00
parent beadea5305
commit b63136da52

View file

@ -792,6 +792,9 @@ def _enable_certificate(domain, new_cert_folder):
logger.debug("Restarting services...") logger.debug("Restarting services...")
for service in ("postfix", "dovecot", "metronome"): for service in ("postfix", "dovecot", "metronome"):
# Ugly trick to not restart metronome if it's not installed
if service == "metronome" and os.system("dpkg --list | grep -q 'ii *metronome'") != 0:
continue
_run_service_command("restart", service) _run_service_command("restart", service)
if os.path.isfile("/etc/yunohost/installed"): if os.path.isfile("/etc/yunohost/installed"):