CMS 3D CMS Logo

Functions
mergeAndRegister Namespace Reference

Functions

def filecheck (rootfile)
 
def sendmail (EmailAddress, run)
 

Function Documentation

def mergeAndRegister.filecheck (   rootfile)

Definition at line 21 of file mergeAndRegister.py.

References mps_alisetup.append, FrontierConditions_GlobalTag_cff.file, join(), and sendmail().

21 def filecheck(rootfile):
22  f = TFile(rootfile)
23  if (f.IsZombie()):
24  #print "File corrupted"
25  f.Close()
26  return 0
27  else:
28  hist = f.FindObjectAny("reportSummaryContents")
29  #(skip filecheck for HcalTiming files!!)
30  if (hist == None and rootfile.rfind('HcalTiming') == -1):
31  #print "File is incomplete"
32  f.Close()
33  return 0
34  else:
35  #print "File is OK"
36  f.Close()
37  return 1
38 
39 
40 
def filecheck(rootfile)
def mergeAndRegister.sendmail (   EmailAddress,
  run 
)

Definition at line 10 of file mergeAndRegister.py.

Referenced by filecheck().

10 def sendmail(EmailAddress,run):
11  s=smtplib.SMTP("localhost")
12  tolist=[EmailAddress]
13  body="File merge failed by unknown reason for run"+run
14  msg = MIMEText(body)
15  msg['Subject'] = "File merge failed."
16  msg['From'] = ServerMail
17  msg['To'] = EmailAddress
18  s.sendmail(ServerMail,tolist,msg.as_string())
19  s.quit()
20 
def sendmail(EmailAddress, run)