98 parser = argparse.ArgumentParser(description=
'Run all SiStrip DAQ O2Os at the same time.')
99 parser.add_argument(
'since', metavar=
'SINCE', type=str, help=
'Run number.')
100 parser.add_argument(
'cfgfile', metavar=
'CFGLINES', help=
'File containing configuration lines.')
101 parser.add_argument(
'--skiplistFile', default=
'', help=
'File containing the devices to be skipped in G1 O2O.')
102 parser.add_argument(
'--whitelistFile', default=
'', help=
'File of the whitelisted devices in G1 O2O.')
104 parser.add_argument(
'--analyzers',
105 default=
'SiStripO2OBadStrip,SiStripO2OFedCabling,SiStripO2OLatency,SiStripO2ONoises,SiStripO2OPedestals,SiStripO2OThreshold',
106 help=
'Which EDAnalyzers to run.')
107 parser.add_argument(
'--mail-from', default=
'trk.o2o@cern.ch', help=
'Account to send email notification.')
108 parser.add_argument(
'--mail-to', default=
'cms-tracker-o2o-notification@cern.ch', help=
'List of O2O notification recipients.')
109 parser.add_argument(
'--mail-log-to', default=
'trk.o2o@cern.ch', help=
'List of O2O log recipients.')
110 parser.add_argument(
'--db', default=
'pro', help=
'The database for o2o job management: pro ( for prod ) or dev ( for prep ). Default: %(default)s.')
111 parser.add_argument(
'--debug', action=
"store_true", default=
False, help=
'Switch on debug mode. Default: %(default)s.')
113 args = parser.parse_args()
115 args.mail_to = args.mail_log_to
117 args.analyzers = args.analyzers.strip().
split(
',')
118 args.mail_to = args.mail_to.strip().
split(
',')
119 args.mail_log_to = args.mail_log_to.strip().
split(
',')
123 logdir = os.environ[logDirVar]
if logDirVar
in os.environ
else '/tmp'
124 if not os.path.exists(logdir):
126 logfile = os.path.join(logdir,
'SiStripsO2O_Run%s.log' %
str(args.since))
127 loglevel = logging.DEBUG
if args.debug
else logging.INFO
128 helper.configLogger(logfile, loglevel)
132 helper.send_mail(
'O2O Failure, IOV: %s' % args.since, traceback.format_exc(), args.mail_to, args.mail_from)
136 is_ok, status =
run(args)
137 summary(args, is_ok, status, logfile)
141 helper.send_mail(
'O2O Failure, IOV: %s' % args.since, traceback.format_exc(), args.mail_to, args.mail_from)
145 return ' --- O2O FAILED! ---'