service_regen_conf is deprecated in factor of regen_conf

This commit is contained in:
Alexandre Aubin 2021-01-22 03:37:29 +01:00
parent c659216e23
commit 9c11fd58e2

View file

@ -8,7 +8,7 @@ from collections import OrderedDict
from moulinette import m18n from moulinette import m18n
from yunohost.utils.error import YunohostError from yunohost.utils.error import YunohostError
from moulinette.utils.log import getActionLogger from moulinette.utils.log import getActionLogger
from yunohost.service import service_regen_conf from yunohost.regenconf import regen_conf
logger = getActionLogger('yunohost.settings') logger = getActionLogger('yunohost.settings')
@ -325,13 +325,13 @@ def trigger_post_change_hook(setting_name, old_value, new_value):
@post_change_hook("security.nginx.compatibility") @post_change_hook("security.nginx.compatibility")
def reconfigure_nginx(setting_name, old_value, new_value): def reconfigure_nginx(setting_name, old_value, new_value):
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['nginx']) regen_conf(names=['nginx'])
@post_change_hook("security.ssh.compatibility") @post_change_hook("security.ssh.compatibility")
def reconfigure_ssh(setting_name, old_value, new_value): def reconfigure_ssh(setting_name, old_value, new_value):
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['ssh']) regen_conf(names=['ssh'])
@post_change_hook("smtp.allow_ipv6") @post_change_hook("smtp.allow_ipv6")
@ -342,7 +342,7 @@ def reconfigure_ssh(setting_name, old_value, new_value):
@post_change_hook("security.postfix.compatibility") @post_change_hook("security.postfix.compatibility")
def reconfigure_postfix(setting_name, old_value, new_value): def reconfigure_postfix(setting_name, old_value, new_value):
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['postfix']) regen_conf(names=['postfix'])
@post_change_hook("pop3.enabled") @post_change_hook("pop3.enabled")
@ -364,9 +364,9 @@ def reconfigure_dovecot(setting_name, old_value, new_value):
] ]
subprocess.call(command, env=environment) subprocess.call(command, env=environment)
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['dovecot']) regen_conf(names=['dovecot'])
else: else:
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['dovecot']) regen_conf(names=['dovecot'])
command = ['apt-get', '-y', 'remove', dovecot_package] command = ['apt-get', '-y', 'remove', dovecot_package]
subprocess.call(command, env=environment) subprocess.call(command, env=environment)