Skip to content

Commit

Permalink
Propagate [JOB ABORTED] to mail subject
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Balogh <pbalogh@redhat.com>
  • Loading branch information
petr-balogh authored and openshift-cherrypick-robot committed May 9, 2024
1 parent 7a79671 commit 3c45ec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocs_ci/framework/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

def signal_term_handler(sig, frame):
print(f"Got SIGTERM: {sig}")
if hasattr(framework.config, "RUN"):
framework.config.RUN["aborted"] = True
global kill_counter
if kill_counter:
print("Second attempt to SIGTERM, exiting process with RC: 143")
Expand Down
4 changes: 4 additions & 0 deletions ocs_ci/utility/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,11 @@ def email_reports(session):
[recipients.append(mailid) for mailid in mailids.split(",")]
sender = "ocs-ci@redhat.com"
msg = MIMEMultipart("alternative")
aborted_message = ""
if config.RUN.get("aborted"):
aborted_message = "[JOB ABORTED] "
msg["Subject"] = (
f"{aborted_message}"
f"ocs-ci results for {get_testrun_name()} "
f"({build_str}"
f"RUN ID: {config.RUN['run_id']}) "
Expand Down

0 comments on commit 3c45ec9

Please sign in to comment.