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 ?

This commit is contained in:
Alexandre Aubin 2024-07-07 16:38:46 +02:00
parent b5e6f02d7d
commit 1bb81e8f69

View file

@ -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