diff --git a/app/repositories/system.py b/app/repositories/system.py index 7c8c6d4..fff203f 100644 --- a/app/repositories/system.py +++ b/app/repositories/system.py @@ -1,6 +1,5 @@ import asyncio import re -from os import path from decouple import config from fastapi import HTTPException, Request, status @@ -38,20 +37,6 @@ elif PLATFORM == APIPlatform.NATIVE_PYTHON: else: raise RuntimeError(f"Unknown platform {PLATFORM}") -SHELL_SCRIPT_PATH = config("shell_script_path") -GET_DEBUG_LOG_SCRIPT = path.join(SHELL_SCRIPT_PATH, "config.scripts", "blitz.debug.sh") - - -def _check_shell_scripts_status(): - if not path.exists(SHELL_SCRIPT_PATH): - raise Exception(f"invalid shell script path: {SHELL_SCRIPT_PATH}") - - if not path.isfile(GET_DEBUG_LOG_SCRIPT): - raise Exception(f"Required file does not exist: {GET_DEBUG_LOG_SCRIPT}") - - -_check_shell_scripts_status() - def password_valid(password: str): if len(password) < 8: diff --git a/app/repositories/system_impl/raspiblitz.py b/app/repositories/system_impl/raspiblitz.py index 313366a..c0d28b2 100644 --- a/app/repositories/system_impl/raspiblitz.py +++ b/app/repositories/system_impl/raspiblitz.py @@ -16,6 +16,20 @@ from app.utils import ( ) SHELL_SCRIPT_PATH = config("shell_script_path") +GET_DEBUG_LOG_SCRIPT = os.path.join( + SHELL_SCRIPT_PATH, "config.scripts", "blitz.debug.sh" +) + + +def _check_shell_scripts_status(): + if not os.path.exists(SHELL_SCRIPT_PATH): + raise Exception(f"invalid shell script path: {SHELL_SCRIPT_PATH}") + + if not os.path.isfile(GET_DEBUG_LOG_SCRIPT): + raise Exception(f"Required file does not exist: {GET_DEBUG_LOG_SCRIPT}") + + +_check_shell_scripts_status() async def get_system_info_impl() -> SystemInfo: