From 1bb81e8f690c47af73e8743d2cfe543f169bdfab Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 7 Jul 2024 16:38:46 +0200 Subject: [PATCH] log: small hack when dumping log right after script failure, prevent a weird edge case where it'll dump the log of the resource provisioning instead of the script, guessing it's because it doesn't find 'ynh_exit_properly' near the end of the log ? --- src/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log.py b/src/log.py index 7950fca78..341770a56 100755 --- a/src/log.py +++ b/src/log.py @@ -791,7 +791,7 @@ class OperationLogger: # Get the 20 lines before the last 'ynh_exit_properly' rev_lines = list(reversed(lines)) - for i, line in enumerate(rev_lines): + for i, line in enumerate(rev_lines[:50]): if line.endswith("+ ynh_exit_properly"): lines_to_display = reversed(rev_lines[i : i + 20]) break