ATLAS Offline Software
Functions | Variables
TRTCalibrationMessage Namespace Reference

Functions

def EmailNotification (jobStatus)
 

Variables

 parser
 
 type
 
 int
 
 help
 
 args = parser.parse_args()
 

Detailed Description

Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration

Function Documentation

◆ EmailNotification()

def TRTCalibrationMessage.EmailNotification (   jobStatus)

Definition at line 6 of file TRTCalibrationMessage.py.

6 def EmailNotification(jobStatus):
7 
8  AtlasBuildBranch=os.environ.get("AtlasBuildBranch" , "UNDEFINED")
9  AthenaPlatform =os.environ.get("Athena_PLATFORM" , "UNDEFINED")
10  AtlasRelease =os.environ.get("ATLAS_RELEASE_BASE", "UNDEFINED")
11  Atlasbuild =os.environ.get("AtlasBuildStamp" , "UNDEFINED")
12 
13  if AtlasBuildBranch != "24.0" and AtlasBuildBranch != "main":
14  print("AtlasBuildBranch not 24.0 or main. Exiting.")
15  sys.exit(0)
16 
17 
18  mserver = "cernmx.cern.ch"
19  mfrom = "no-reply@cern.ch"
20  mto = ["atlas-trt-offline-shifts@cern.ch","atlas-trt-expert-shifters@cern.ch"]
21  msubject = "ART test notification: TRT calibration Workflow for %s" % (AtlasBuildBranch)
22 
23  status="*SUCCEEDED*"
24  if jobStatus.ACCU != 0 or jobStatus.MERGE != 0:
25  status = "*FAILED*\n"
26  status += "\t- The TRT ACCU transform %s.\n" % ("*is broken*" if jobStatus.ACCU else "works")
27  status += "\t- The TRT MERGE transform %s." % ("*is broken*" if jobStatus.MERGE else "works")
28 
29  # assemble mail body
30  mbody = "Dear TRT expert/shifter\n\n"
31  mbody += " This email is generated by the ART test InnerDetector/InDetCalibAlgs/TRT_CalibAlgs/test/test_TRTCalibration.sh \n\n"
32  mbody += " The test has %s\n\n" % (status)
33  mbody += " For %s\n\n" % (AtlasRelease)
34  mbody += " You can check the results in https://atlas-art-data.web.cern.ch/atlas-art-data/local-output/\n"
35  mbody += " Outputs are in /eos/atlas/atlascerngroupdisk/data-art/local-output/%s/Athena/%s/%s/\n\n" % (AtlasBuildBranch,AthenaPlatform,Atlasbuild)
36  mbody += "Cheers\n"
37  mbody += "\tYour amazing TRT Calibration test"
38 
39  fullmsg = "To: %s\nSubject: %s\n\n%s" % ("".join(("%s," % str(_mto_)) for _mto_ in mto ), msubject, mbody)
40 
41  print("Email body:\n")
42  print(fullmsg)
43  print("Email sent to:")
44 
45  try :
46  con = smtplib.SMTP(mserver)
47  print("\t- %s"% (mto))
48  con.sendmail(mfrom, mto, fullmsg)
49  con.quit()
50  except OSError as e:
51  print("ERROR: Failed sending email notification\n",e)
52  exit(e.errno)
53 
54 
55 

Variable Documentation

◆ args

TRTCalibrationMessage.args = parser.parse_args()

Definition at line 65 of file TRTCalibrationMessage.py.

◆ help

TRTCalibrationMessage.help

Definition at line 63 of file TRTCalibrationMessage.py.

◆ int

TRTCalibrationMessage.int

Definition at line 63 of file TRTCalibrationMessage.py.

◆ parser

TRTCalibrationMessage.parser
Initial value:
1 = argparse.ArgumentParser(prog='python -m TRT_CalibAlgs.TRTCalibrationMessage',
2  description=)

Definition at line 59 of file TRTCalibrationMessage.py.

◆ type

TRTCalibrationMessage.type

Definition at line 63 of file TRTCalibrationMessage.py.

TRTCalibrationMessage.EmailNotification
def EmailNotification(jobStatus)
Definition: TRTCalibrationMessage.py:6
calibdata.exit
exit
Definition: calibdata.py:236
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
str
Definition: BTagTrackIpAccessor.cxx:11
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70