[enh] Don't change ssh conf if not specified directly

This commit is contained in:
ljf 2018-08-26 14:38:46 +02:00 committed by Alexandre Aubin
parent 8598d81bb1
commit 7f3a35dac0

View file

@ -39,8 +39,8 @@ from moulinette import m18n
from moulinette.core import MoulinetteError
from moulinette.utils import log, filesystem
from yunohost.hook import hook_callback
from yunohost.log import is_unit_operation
from yunohost.hook import hook_callback, hook_list
BASE_CONF_PATH = '/home/yunohost.conf'
BACKUP_CONF_DIR = os.path.join(BASE_CONF_PATH, 'backup')
@ -422,6 +422,12 @@ def service_regen_conf(operation_logger, names=[], with_diff=False, force=False,
# return the arguments to pass to the script
return pre_args + [service_pending_path, ]
# Don't regen SSH if not specifically specified
if not names:
names = hook_list('conf_regen', list_by='name',
show_info=False)['hooks']
names.remove('ssh')
pre_result = hook_callback('conf_regen', names, pre_callback=_pre_call)
# Update the services name