From 1c6185414346b2531451ef97844263f6cae22117 Mon Sep 17 00:00:00 2001 From: kodi Date: Sun, 22 Mar 2026 10:22:25 +0100 Subject: [PATCH] fix: verwijder dode Flask-stijl legacy route in app_system.py De route @router.post("/api//") gebruikte Flask-syntaxis die nooit matcht in FastAPI. Dead code verwijderd. Co-Authored-By: Claude Sonnet 4.6 --- control/app_system.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/control/app_system.py b/control/app_system.py index b442741..37e439b 100644 --- a/control/app_system.py +++ b/control/app_system.py @@ -95,15 +95,6 @@ def init_system_router(session, podman_api_base: str, workloads_dir: str) -> API except Exception as e: raise HTTPException(status_code=500, detail=str(e)) - @router.post("/api//") - def legacy_api_action(action: str, unit: str): - # legacy flask-like path; keep behavior (even if not used by index.html) - if action not in ("status", "start", "stop", "restart"): - return {"error": "Invalid action"}, 400 - cmd = ["systemctl", "--user", action, unit] - code, out = _run_systemctl_action(action, unit) - return {"cmd": " ".join(cmd), "exit": code, "output": out} - @router.post("/{action}/{unit}") def api_action(action: str, unit: str): if action not in ("status", "start", "stop", "restart"):