refactor: verplaats run() duplicaat naar common.py

run() stond identiek in app.py en app_system.py. Verplaatst naar
common.py als single source of truth; beide modules importeren
nu de centrale versie.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 10:26:34 +01:00
parent 1c61854143
commit 580c301718
3 changed files with 13 additions and 17 deletions
+11
View File
@@ -1,6 +1,17 @@
import subprocess
from fastapi import HTTPException
def run(cmd):
try:
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
output = (result.stdout or "") + (result.stderr or "")
return result.returncode, output.strip()
except Exception as e:
return 1, str(e)
def _podman_get_json_checked(session, url: str):
r = session.get(url)
if r.status_code >= 400: