fix: use relative paths for STAGING_ROOT and LOG_DIR so backend works on host regardless of install location

This commit is contained in:
Claus Lohmar 2026-07-25 17:50:13 +00:00
parent f7c6527d3d
commit f1978008bd
3 changed files with 3 additions and 3 deletions

View file

@ -41,7 +41,7 @@ _ch.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(message)s"))
logger.addHandler(_ch)
# File handler → shared log directory
LOG_DIR = Path("/mnt/converter/logs")
LOG_DIR = Path(__file__).resolve().parent.parent / "logs"
LOG_DIR.mkdir(parents=True, exist_ok=True)
_fh = RotatingFileHandler(
LOG_DIR / "vm-bench-backend.log", maxBytes=10 * 1024 * 1024, backupCount=5,

View file

@ -15,7 +15,7 @@ from pathlib import Path
from dataclasses import dataclass
from typing import Optional
STAGING_ROOT = Path("/mnt/converter/tmp")
STAGING_ROOT = Path(__file__).resolve().parent.parent / "tmp"
STAGING_IN = STAGING_ROOT / "in"
logger = logging.getLogger("backend.converter")

View file

@ -30,7 +30,7 @@ from converter import extract_if_needed, discover_disk, detect_efi
logger = logging.getLogger("backend.provisioner")
STAGING_ROOT = Path("/mnt/converter/tmp")
STAGING_ROOT = Path(__file__).resolve().parent.parent / "tmp"
STAGING_IN = STAGING_ROOT / "in"
STAGING_OUT = STAGING_ROOT / "out"