Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:13

0001 from __future__ import print_function
0002 import re
0003 import sys
0004 import ROOT
0005 
0006 fname_root = "dqm_file1.root"
0007 fname_report = "dqm_file1_jobreport.xml"
0008 
0009 kCmsGuid = "cms::edm::GUID"
0010 
0011 f = ROOT.TFile.Open(fname_root)
0012 guid_file = getattr(f, kCmsGuid)
0013 f.Close()
0014 
0015 guid_report = None
0016 with open(fname_report) as f:
0017     guid_re = re.compile("<GUID>(?P<guid>.*)</GUID>")
0018     for line in f:
0019         m = guid_re.search(line)
0020         if m:
0021             guid_report = m.group("guid")
0022             break
0023 
0024 if guid_report is None:
0025     print("Did not find GUID from %s" % fname_report)
0026     sys.exit(1)
0027 if guid_file != guid_report:
0028     print("GUID from file %s differs from GUID from job report %s" % (guid_file, guid_report))
0029     sys.exit(1)
0030 
0031 print("SUCCEEDED")