Move Fail2Ban exceptions into central app.exceptions module
This commit is contained in:
@@ -23,7 +23,7 @@ from app.exceptions import JailNotFoundError, JailOperationError
|
||||
from app.models.ban import ActiveBanListResponse, BanRequest, UnbanAllResponse, UnbanRequest
|
||||
from app.models.jail import JailCommandResponse
|
||||
from app.services import jail_service
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
router: APIRouter = APIRouter(prefix="/api/bans", tags=["Bans"])
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ from app.models.config import (
|
||||
ServiceStatusResponse,
|
||||
)
|
||||
from app.services import config_file_service, config_service, jail_service, log_service, setup_service
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
log: structlog.stdlib.BoundLogger = structlog.get_logger()
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from app.dependencies import (
|
||||
)
|
||||
from app.models.geo import GeoCacheStatsResponse, GeoReResolveResponse, IpLookupResponse
|
||||
from app.services import geo_service, jail_service
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
router: APIRouter = APIRouter(prefix="/api/geo", tags=["Geo"])
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ from app.services import (
|
||||
filter_config_service,
|
||||
jail_config_service,
|
||||
)
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
from app.utils.runtime_state import (
|
||||
clear_activation_record,
|
||||
clear_pending_recovery,
|
||||
|
||||
@@ -40,7 +40,7 @@ from app.models.jail import (
|
||||
JailListResponse,
|
||||
)
|
||||
from app.services import jail_service
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
router: APIRouter = APIRouter(prefix="/api/jails", tags=["Jails"])
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from app.dependencies import AuthDep, Fail2BanSocketDep
|
||||
from app.models.server import ServerSettingsResponse, ServerSettingsUpdate
|
||||
from app.services import server_service
|
||||
from app.exceptions import ServerOperationError
|
||||
from app.utils.fail2ban_client import Fail2BanConnectionError
|
||||
from app.exceptions import Fail2BanConnectionError
|
||||
|
||||
router: APIRouter = APIRouter(prefix="/api/server", tags=["Server"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user