From 840b2f36f5c1bb60ddee99ce70bfcf5e74de25bd Mon Sep 17 00:00:00 2001 From: Georges Da Costa <dacosta@irit.fr> Date: Tue, 26 Jul 2022 21:58:16 +0200 Subject: [PATCH] corrects a bug from moj --- expetator/monitoring_csv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/expetator/monitoring_csv.py b/expetator/monitoring_csv.py index 8eb8b9a..03f4d74 100644 --- a/expetator/monitoring_csv.py +++ b/expetator/monitoring_csv.py @@ -15,9 +15,13 @@ def _read_csv(filename): def read_host_csv(prefix, hostname, startTime, basename, fullname, archive_fid=None): fullpath= '%s_%s/%s_%s_%s' % (basename, prefix, hostname, fullname, startTime) if archive_fid is None: + if not os.path.exists(fullpath): + fullpath = '%s_%s/%s_%s_%s' % (basename, prefix, 'localhost', fullname, startTime) with open(fullpath) as file_id: data = _read_csv(fullpath) else: + if not fullpath in archive_fid.namelist(): + fullpath = '%s_%s/%s_%s_%s' % (basename, prefix, 'localhost', fullname, startTime) with archive_fid.open(fullpath) as file_id: data = _read_csv(file_id) data = data.dropna(axis='columns') -- GitLab