Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions BBS-make-PROPAGATION_STATUS_DB.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import time
import subprocess

import bbs.notify

import BBSutils
import BBSvars
import BBSbase
Expand All @@ -30,8 +32,23 @@ def make_PROPAGATION_STATUS_DB(final_repo):
## subprocess.run() if this code is runned by the Task Scheduler
## on Windows (the child process tends to almost always return an
## error). Apparently using 'stderr=subprocess.STDOUT' fixes this pb.
subprocess.run(cmd, stdout=None, stderr=subprocess.STDOUT, shell=True,
check=True)
try:
subprocess.run(cmd, stdout=None, stderr=subprocess.STDOUT, shell=True,
check=True)
except subprocess.CalledProcessError as e:
subject = (f"[BBS] Postrun failure on {BBSvars.node_hostname} for "
f"{BBSvars.bioc_version} {BBSvars.buildtype} builds")
msg_body = f"""\
Postrun failed on {BBSvars.node_hostname} for the {BBSvars.bioc_version}
{BBSvars.buildtype} builds with the following error:

Error: {e}"""
bbs.notify.mode = "do-it"
bbs.notify.sendtextmail("[email protected]",
["[email protected]"],
subject,
msg_body)
raise e
return

##############################################################################
Expand Down