diff --git a/dockers/grafana/docker-inventaire/inventaire.py b/dockers/grafana/docker-inventaire/inventaire.py index 5364255..a0cc392 100644 --- a/dockers/grafana/docker-inventaire/inventaire.py +++ b/dockers/grafana/docker-inventaire/inventaire.py @@ -7,6 +7,8 @@ import tempfile import threading import time import subprocess +import glob +import shutil from http.server import BaseHTTPRequestHandler, HTTPServer from urllib.parse import quote @@ -1191,6 +1193,11 @@ def git_archive(): f"Git : récupération de {GIT_URL}" ) + # Nettoyage des archives temporaires précédentes + for path in glob.glob("/tmp/docker-inventaire-*"): + if os.path.isdir(path): + shutil.rmtree(path, ignore_errors=True) + tempdir = tempfile.mkdtemp( prefix="docker-inventaire-" )