diff --git a/lib/yunohost/hook.py b/lib/yunohost/hook.py index 4c4bd063f..9aeb3564c 100644 --- a/lib/yunohost/hook.py +++ b/lib/yunohost/hook.py @@ -189,14 +189,15 @@ def hook_callback(action, hooks=[], args=None): # Add similar hooks to the list # For example: Having a 16-postfix hook in the list will execute a # xx-postfix_dkim as well + all_hooks = [] for n in hooks: - for key in hooks.keys(): - if key.startswith("%s_" % n) \ - and n not in hooks: - hooks.append(n) + for key in hooks_names.keys(): + if key == n or key.startswith("%s_" % n) \ + and key not in all_hooks: + all_hooks.append(key) # Iterate over given hooks names list - for n in hooks: + for n in all_hooks: try: hl = hooks_names[n] except KeyError: diff --git a/lib/yunohost/service.py b/lib/yunohost/service.py index 8f3a7693a..ceac04add 100644 --- a/lib/yunohost/service.py +++ b/lib/yunohost/service.py @@ -292,7 +292,7 @@ def service_regenconf(service=None, force=False): if service not in _get_services().keys(): raise MoulinetteError(errno.EINVAL, m18n.n('service_unknown', service)) - hook_callback('conf_regen', [service] , args=[arg_force]) + hook_callback('conf_regen', [service] , args=[force]) msignals.display(m18n.n('service_configured', service), 'success')