Améliorations BO3
Build and Push Docker Image / build-and-push (push) Successful in 35s

This commit is contained in:
xavier committed 2026-08-29 11:18:17 +02:00
1 parent e8c2bc4418
commit 57db888e89
2 files changed
+27 -28

No files matched your search

+18 -23
View File
@@ -7,34 +7,29 @@ def obtenir_infos_serveur():
# Espace disque racine /
total, used, free = shutil.disk_usage("/")
# Recherche intelligente de la partition RAID ou /DATA via psutil
# Recherche spécifique de la partition RAID /DATA ou du périphérique md
data_stats = {}
try:
partitions = psutil.disk_partitions(all=False)
for p in partitions:
# Priorité à la détection d'un périphérique md (RAID) ou du point de montage /DATA
if "md" in p.device or p.mountpoint == "/DATA":
try:
dt, du, df = shutil.disk_usage(p.mountpoint)
data_stats = {
"device": p.device,
"mountpoint": p.mountpoint,
"total_gb": round(dt / (2**30), 2),
"utilise_gb": round(du / (2**30), 2),
"libre_gb": round(df / (2**30), 2),
"pourcentage": round((du / dt) * 100, 1)
}
if "md" in p.device:
break # On privilégie en premier le RAID détecté
except Exception:
pass
partitions = psutil.disk_partitions(all=True)
point_montage_cible = None
# Fallback sur /DATA si aucune détection spécifique md n'a eu lieu
if not data_stats and os.path.exists("/DATA"):
# On cherche en priorité un montage sur /DATA ou un device contenant 'md'
for p in partitions:
if p.mountpoint == "/DATA" or "md" in p.device:
point_montage_cible = p.mountpoint
break
if point_montage_cible:
dt, du, df = shutil.disk_usage(point_montage_cible)
data_stats = {
"total_gb": round(dt / (2**30), 2),
"utilise_gb": round(du / (2**30), 2),
"libre_gb": round(df / (2**30), 2),
"pourcentage": round((du / dt) * 100, 1)
}
elif os.path.exists("/DATA"):
dt, du, df = shutil.disk_usage("/DATA")
data_stats = {
"device": "bind-mount /DATA",
"mountpoint": "/DATA",
"total_gb": round(dt / (2**30), 2),
"utilise_gb": round(du / (2**30), 2),
"libre_gb": round(df / (2**30), 2),