ATLAS Offline Software
Loading...
Searching...
No Matches
TRTCalibrationMessage Namespace Reference

Functions

 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()

TRTCalibrationMessage.EmailNotification ( jobStatus)

Definition at line 6 of file TRTCalibrationMessage.py.

6def 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 += f" You can check the results in https://bigpanda.cern.ch/art/overview/?branch={AtlasBuildBranch}/Athena/{AthenaPlatform}&nlastnightlies=7&view=packages&test_type=local\n"
35 mbody += f" Outputs are in /eos/atlas/atlascerngroupdisk/data-art/local-output/{AtlasBuildBranch}/Athena/{AthenaPlatform}/{Atlasbuild}/\n\n"
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
void print(char *figname, TCanvas *c1)

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.