From 75ba4d52b57f511bc4caa192bd1ca30ab9acea99 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Thu, 3 Apr 2025 09:41:23 +0200 Subject: [PATCH] Repeat 3time in case of send_to_paste_bin failed after 3secongs. Add Costas also to upstream_mails Signed-off-by: Petr "Stone" Hracek --- daily_tests/daily_nightly_tests_report.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/daily_tests/daily_nightly_tests_report.py b/daily_tests/daily_nightly_tests_report.py index d15baeb..98e37a4 100755 --- a/daily_tests/daily_nightly_tests_report.py +++ b/daily_tests/daily_nightly_tests_report.py @@ -4,6 +4,7 @@ import smtplib import argparse import subprocess +import time from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText @@ -19,6 +20,7 @@ upstream_mails = [ "phracek@redhat.com", "lholmqui@redhat.com", + "cpapasta@redhat.com", "nodeshiftcore@redhat.com", ] @@ -202,10 +204,14 @@ def send_file_to_pastebin(self, log_path, log_name: str): send_paste_bin = os.getenv("HOME") + "/ci-scripts/send_to_paste_bin.sh" cmd = f'{send_paste_bin} "{log_path}" "{log_name}"' print(f"sending logs to pastebin: {cmd}") - try: - run_command(cmd) - except subprocess.CalledProcessError: - pass + for count in range(5): + try: + run_command(cmd) + break + except subprocess.CalledProcessError: + print(f"ERROR: Sending to pastebin by command {cmd} failed") + pass + time.sleep(3) def get_pastebin_url(self, log_name: str) -> str: with open(log_name, "r") as f: