Remove helper indirection and import shared service helpers directly
This commit is contained in:
@@ -49,7 +49,7 @@ from app.exceptions import (
|
||||
JailNotFoundError,
|
||||
JailNotFoundInConfigError,
|
||||
)
|
||||
from app.helpers.jail_helpers import reload_jails
|
||||
from app.services.jail_service import reload_all
|
||||
from app.models.config import (
|
||||
ActionConfig,
|
||||
ActionConfigUpdate,
|
||||
@@ -96,7 +96,7 @@ class _JailServiceProxy:
|
||||
kwargs["include_jails"] = include_jails
|
||||
if exclude_jails is not None:
|
||||
kwargs["exclude_jails"] = exclude_jails
|
||||
await reload_jails(socket_path, **kwargs)
|
||||
await reload_all(socket_path, **kwargs)
|
||||
|
||||
|
||||
jail_service = _JailServiceProxy()
|
||||
@@ -114,7 +114,7 @@ async def _reload_all(
|
||||
if exclude_jails is not None:
|
||||
kwargs["exclude_jails"] = exclude_jails
|
||||
|
||||
await jail_service.reload_all(socket_path, **kwargs)
|
||||
await reload_all(socket_path, **kwargs)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -1003,6 +1003,20 @@ def _set_jail_local_key_sync(
|
||||
)
|
||||
|
||||
|
||||
# Public shared helpers for config file services.
|
||||
ordered_config_files = _ordered_config_files
|
||||
build_parser = _build_parser
|
||||
is_truthy = _is_truthy
|
||||
parse_multiline = _parse_multiline
|
||||
parse_jails_sync = _parse_jails_sync
|
||||
build_inactive_jail = _build_inactive_jail
|
||||
get_active_jail_names = _get_active_jail_names
|
||||
validate_jail_config_sync = _validate_jail_config_sync
|
||||
set_jail_local_key_sync = _set_jail_local_key_sync
|
||||
safe_jail_name = _safe_jail_name
|
||||
safe_filter_name = _safe_filter_name
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Public API
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user