mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
automatically ignore the service in diagnosis if it has been deactivated with the ynh cli
This commit is contained in:
parent
cfcbeb3fa9
commit
66f8e31260
1 changed files with 7 additions and 0 deletions
|
@ -26,6 +26,7 @@ from glob import glob
|
|||
from datetime import datetime
|
||||
|
||||
from moulinette import m18n
|
||||
from yunohost.utils.diagnosis import diagnosis_ignore, diagnosis_unignore
|
||||
from yunohost.utils.error import YunohostError, YunohostValidationError
|
||||
from moulinette.utils.process import check_output
|
||||
from moulinette.utils.log import getActionLogger
|
||||
|
@ -296,6 +297,9 @@ def service_enable(names):
|
|||
names = [names]
|
||||
for name in names:
|
||||
if _run_service_command("enable", name):
|
||||
services = _get_services()
|
||||
if name in services:
|
||||
diagnosis_unignore({"services": [{"service": name}]})
|
||||
logger.success(m18n.n("service_enabled", service=name))
|
||||
else:
|
||||
raise YunohostError(
|
||||
|
@ -315,6 +319,9 @@ def service_disable(names):
|
|||
names = [names]
|
||||
for name in names:
|
||||
if _run_service_command("disable", name):
|
||||
services = _get_services()
|
||||
if name in services:
|
||||
diagnosis_ignore({"services": [{"service": name}]})
|
||||
logger.success(m18n.n("service_disabled", service=name))
|
||||
else:
|
||||
raise YunohostError(
|
||||
|
|
Loading…
Add table
Reference in a new issue