fix: verwijder dode Flask-stijl legacy route in app_system.py

De route @router.post("/api/<action>/<unit>") gebruikte Flask-syntaxis
die nooit matcht in FastAPI. Dead code verwijderd.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 10:22:25 +01:00
parent bacab3b20a
commit 1c61854143
-9
View File
@@ -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/<action>/<unit>")
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"):