mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix listing of succeed/failed hook names
This commit is contained in:
parent
877fe50685
commit
c74bff31d1
1 changed files with 6 additions and 3 deletions
|
@ -493,11 +493,14 @@ def service_regen_conf(operation_logger, names=[], with_diff=False, force=False,
|
||||||
|
|
||||||
pre_result = hook_callback('conf_regen', names, pre_callback=_pre_call)
|
pre_result = hook_callback('conf_regen', names, pre_callback=_pre_call)
|
||||||
|
|
||||||
# Update the services name
|
# Keep only the hook names with at least one success
|
||||||
names = {n: [p for p, c in v.items() if c['state'] == "failed"] for n, v in pre_result.items()}.keys()
|
names = [hook for hook, infos in pre_result.items()
|
||||||
|
if any(result["state"] == "succeed" for result in infos.values())]
|
||||||
|
|
||||||
|
# FIXME : what do in case of partial success/failure ...
|
||||||
if not names:
|
if not names:
|
||||||
ret_failed = {n: [p for p, c in v.items() if c['state'] == "failed"] for n, v in pre_result.items()}
|
ret_failed = [hook for hook, infos in pre_result.items()
|
||||||
|
if any(result["state"] == "failed" for result in infos.values())]
|
||||||
raise YunohostError('service_regenconf_failed',
|
raise YunohostError('service_regenconf_failed',
|
||||||
services=', '.join(ret_failed))
|
services=', '.join(ret_failed))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue