Update tools.py: use _run_service_command to enable+start yunohost-firewall during postinstall and prevent a warning about lack of diagnosis ignore rule

This commit is contained in:
Alexandre Aubin 2024-06-30 18:34:38 +02:00 committed by GitHub
parent c965f13f50
commit 5ef0c84c0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -41,7 +41,6 @@ from yunohost.app_catalog import (
)
from yunohost.domain import domain_add
from yunohost.firewall import firewall_upnp
from yunohost.service import service_start, service_enable
from yunohost.regenconf import regen_conf
from yunohost.utils.system import (
_dump_sources_list,
@ -156,6 +155,7 @@ def tools_postinstall(
force_diskspace=False,
overwrite_root_password=True,
):
from yunohost.service import _run_service_command
from yunohost.dyndns import _dyndns_available, dyndns_unsubscribe
from yunohost.utils.dns import is_yunohost_dyndns_domain
from yunohost.utils.password import (
@ -270,8 +270,8 @@ def tools_postinstall(
os.system("touch /etc/yunohost/installed")
# Enable and start YunoHost firewall at boot time
service_enable("yunohost-firewall")
service_start("yunohost-firewall")
_run_service_command("enable", "yunohost-firewall")
_run_service_command("start", "yunohost-firewall")
regen_conf(names=["ssh"], force=True)