From 95f32199230e9baac0cda464ce3266cdc5b3db73 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:39:20 +0200 Subject: [PATCH] Update log.py: log_file -> log_md_fullpath (otherwise it feel like log_file refers to the .log) --- src/log.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/log.py b/src/log.py index d84c84619..c70e67c2e 100755 --- a/src/log.py +++ b/src/log.py @@ -89,19 +89,19 @@ def _update_log_parent_symlinks(): logs = glob.iglob("*" + METADATA_FILE_EXT, root_dir=OPERATIONS_PATH) for log_md in logs: - log_file = os.path.join(OPERATIONS_PATH, log_md) - if os.path.getctime(log_file) < one_year_ago: + log_md_fullpath = os.path.join(OPERATIONS_PATH, log_md) + if os.path.getctime(log_md_fullpath) < one_year_ago: # Let's ignore files older than one year because hmpf reading a shitload of yml is not free continue name = log_md[: -len(METADATA_FILE_EXT)] parent_symlink = os.path.join(OPERATIONS_PATH, f".{name}.parent.yml") - if (os.path.islink(log_file) and os.path.realpath(log_file) == "/dev/null") or os.path.islink(parent_symlink): + if (os.path.islink(log_md_fullpath) and os.path.realpath(log_md_fullpath) == "/dev/null") or os.path.islink(parent_symlink): continue try: metadata = ( - read_yaml(log_file) or {} + read_yaml(log_md_fullpath) or {} ) # Making sure this is a dict and not None..? except Exception as e: # If we can't read the yaml for some reason, report an error and ignore this entry...