CMS 3D CMS Logo

conddb_version_mgr.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 from __future__ import print_function
4 import cx_Oracle
5 import datetime
6 import calendar
7 import sys
8 import logging
9 import CondCore.Utilities.conddb_serialization_metadata as sm
10 import CondCore.Utilities.credentials as auth
11 import os
12 
13 authPathEnvVar = 'COND_AUTH_PATH'
14 prod_db_service = ('cms_orcon_prod',{'w':'cms_orcon_prod/cms_cond_general_w','r':'cms_orcon_prod/cms_cond_general_r'})
15 adg_db_service = ('cms_orcon_adg',{'r':'cms_orcon_adg/cms_cond_general_r'})
16 dev_db_service = ('cms_orcoff_prep',{'w':'cms_orcoff_prep/cms_cond_general_w','r':'cms_orcoff_prep/cms_cond_general_r'})
17 schema_name = 'CMS_CONDITIONS'
18 
19 fmt_str = "[%(asctime)s] %(levelname)s: %(message)s"
20 logLevel = logging.INFO
21 logFormatter = logging.Formatter(fmt_str)
22 
23 def print_table( headers, table ):
24  ws = []
25  for h in headers:
26  ws.append(len(h))
27  for row in table:
28  ind = 0
29  for c in row:
30  c = str(c)
31  if ind<len(ws):
32  if len(c)> ws[ind]:
33  ws[ind] = len(c)
34  ind += 1
35 
36  def printf( row ):
37  line = ''
38  ind = 0
39  for w in ws:
40  fmt = '{:<%s}' %w
41  if ind<len(ws):
42  line += (fmt.format( row[ind] )+' ')
43  ind += 1
44  print(line)
45  printf( headers )
46  hsep = ''
47  for w in ws:
48  fmt = '{:-<%s}' %w
49  hsep += (fmt.format('')+' ')
50  print(hsep)
51  for row in table:
52  printf( row )
53 
55  def __init__(self, db ):
56  self.db = db
57  self.cmssw_boost_map = {}
58  self.boost_run_map = []
59 
60  def fetch_cmssw_boost_map( self ):
61  cursor = self.db.cursor()
62  cursor.execute('SELECT BOOST_VERSION, CMSSW_VERSION FROM CMSSW_BOOST_MAP');
63  rows = cursor.fetchall()
64  self.cmssw_boost_map = {}
65  for r in rows:
66  self.cmssw_boost_map[r[1]]=r[0]
67  return self.cmssw_boost_map
68 
69  def fetch_boost_run_map( self ):
70  cursor = self.db.cursor()
71  cursor.execute('SELECT RUN_NUMBER, RUN_START_TIME, BOOST_VERSION, INSERTION_TIME FROM BOOST_RUN_MAP ORDER BY RUN_NUMBER, INSERTION_TIME')
72  rows = cursor.fetchall()
73  self.boost_run_map = []
74  for r in rows:
75  self.boost_run_map.append( (r[0],r[1],r[2],str(r[3])) )
76  return self.boost_run_map
77 
78  def insert_boost_run_range( self, run, boost_version ):
79  cursor = self.db.cursor()
80  cursor.execute('SELECT MIN(RUN_NUMBER) FROM RUN_INFO WHERE RUN_NUMBER >= :RUN',(run,))
81  min_run = cursor.fetchone()[0]
82  cursor.execute('SELECT START_TIME FROM RUN_INFO WHERE RUN_NUMBER=:RUN',(min_run,))
83  min_run_time = cursor.fetchone()[0]
84  min_run_ts = calendar.timegm( min_run_time.utctimetuple() ) << 32
85  now = datetime.datetime.utcnow()
86  cursor.execute('INSERT INTO BOOST_RUN_MAP ( RUN_NUMBER, RUN_START_TIME, BOOST_VERSION, INSERTION_TIME ) VALUES (:RUN, :RUN_START_T, :BOOST, :TIME)',(run,min_run_ts,boost_version,now) )
87 
88  def insert_cmssw_boost( self, cmssw_version,boost_version ):
89  cursor = self.db.cursor()
90  cursor.execute('INSERT INTO CMSSW_BOOST_MAP ( CMSSW_VERSION, BOOST_VERSION ) VALUES ( :CMSSW_VERSION, :BOOST_VERSION )',(cmssw_version,boost_version))
91 
92  def lookup_boost_in_cmssw( self, cmssw_version ):
93  cmssw_v = sm.check_cmssw_version( cmssw_version )
94  the_arch = None
95  releaseRoot = None
96  if sm.is_release_cycle( cmssw_v ):
97  cmssw_v = sm.strip_cmssw_version( cmssw_v )
98  archs = sm.get_production_arch( cmssw_v )
99  for arch in archs:
100  path = sm.get_release_root( cmssw_v, arch )
101  if os.path.exists(os.path.join(path,cmssw_v)):
102  releaseRoot = path
103  the_arch = arch
104  break
105  if releaseRoot is None:
106  for arch in archs:
107  the_arch = arch
108  releaseRoot = sm.get_release_root( cmssw_v, arch )
109  for r in sorted (os.listdir( releaseRoot )):
110  if r.startswith(cmssw_v):
111  cmssw_v = r
112  logging.debug('Boost version will be verified in release %s' %cmssw_v)
113 
114  if cmssw_v in self.cmssw_boost_map.keys():
115  return self.cmssw_boost_map[cmssw_v]
116 
117  if releaseRoot is None:
118  archs = sm.get_production_arch( cmssw_v )
119  for arch in archs:
120  path = sm.get_release_root( cmssw_v, arch )
121  if os.path.exists(os.path.join(path,cmssw_v)):
122  releaseRoot = path
123  the_arch = arch
124  break
125  logging.debug('Release path: %s' %releaseRoot)
126  boost_version = sm.get_cmssw_boost( the_arch, '%s/%s' %(releaseRoot,cmssw_v) )
127  if not boost_version is None:
128  self.cmssw_boost_map[cmssw_v] = boost_version
129  self.insert_cmssw_boost( cmssw_v,boost_version )
130  return boost_version
131 
132  def populate_for_gts( self ):
133  cursor = self.db.cursor()
134  cursor.execute('SELECT DISTINCT(RELEASE) FROM GLOBAL_TAG')
135  rows = cursor.fetchall()
136  for r in rows:
137  self.lookup_boost_in_cmssw( r[0] )
138 
140  def __init__( self ):
141  self.db = None
142  self.version_db = None
143  self.args = None
144  self.logger = logging.getLogger()
145  self.logger.setLevel(logLevel)
146  consoleHandler = logging.StreamHandler(sys.stdout)
147  consoleHandler.setFormatter(logFormatter)
148  self.logger.addHandler(consoleHandler)
149  self.iovs = None
150  self.versionIovs = None
151 
152  def connect( self ):
153  if self.args.db is None:
154  self.args.db = 'pro'
155  if self.args.db == 'dev' or self.args.db == 'oradev' :
156  db_service = dev_db_service
157  elif self.args.db == 'orapro':
158  db_service = adg_db_service
159  elif self.args.db != 'onlineorapro' or self.args.db != 'pro':
160  db_service = prod_db_service
161  else:
162  raise Exception("Database '%s' is not known." %args.db )
163  if self.args.accessType not in db_service[1].keys():
164  raise Exception('The specified database connection %s does not support the requested action.' %db_service[0])
165  service = db_service[1][self.args.accessType]
166  creds = auth.get_credentials( authPathEnvVar, service, self.args.auth )
167  if creds is None:
168  raise Exception("Could not find credentials for service %s" %service)
169  (username, account, pwd) = creds
170  connStr = '%s/%s@%s' %(username,pwd,db_service[0])
171  self.db = cx_Oracle.connect(connStr)
172  logging.info('Connected to %s as user %s' %(db_service[0],username))
173  self.db.current_schema = schema_name
174 
175  def process_tag_boost_version( self, t, timetype, tagBoostVersion, minIov, timeCut, validate ):
176  if self.iovs is None:
177  self.iovs = []
178  cursor = self.db.cursor()
179  stmt = 'SELECT IOV.SINCE SINCE, IOV.INSERTION_TIME INSERTION_TIME, P.STREAMER_INFO STREAMER_INFO FROM TAG, IOV, PAYLOAD P WHERE TAG.NAME = IOV.TAG_NAME AND P.HASH = IOV.PAYLOAD_HASH AND TAG.NAME = :TAG_NAME'
180  params = (t,)
181  if timeCut and tagBoostVersion is not None and not validate:
182  whereClauseOnSince = ' AND IOV.INSERTION_TIME>:TIME_CUT'
183  stmt = stmt + whereClauseOnSince
184  params = params + (timeCut,)
185  stmt = stmt + ' ORDER BY SINCE'
186  logging.debug('Executing: "%s"' %stmt)
187  cursor.execute(stmt,params)
188  for r in cursor:
189  streamer_info = str(r[2].read())
190  self.iovs.append((r[0],r[1],streamer_info))
191  niovs = 0
192  self.versionIovs = []
193  lastBoost = None
194  update = False
195  if tagBoostVersion is not None:
196  update = True
197  for iov in self.iovs:
198  if validate and timeCut is not None and timeCut < iov[1]:
199  continue
200  niovs += 1
201  iovBoostVersion, tagBoostVersion = sm.update_tag_boost_version( tagBoostVersion, minIov, iov[2], iov[0], timetype, self.version_db.boost_run_map )
202  if minIov is None or iov[0]<minIov:
203  minIov = iov[0]
204  logging.debug('iov: %s - inserted on %s - streamer: %s' %(iov[0],iov[1],iov[2]))
205  logging.debug('current tag boost version: %s minIov: %s' %(tagBoostVersion,minIov))
206  if lastBoost is None or lastBoost!=iovBoostVersion:
207  self.versionIovs.append((iov[0],iovBoostVersion))
208  lastBoost = iovBoostVersion
209 
210  if tagBoostVersion is None:
211  if niovs == 0:
212  logging.warning( 'No iovs found. boost version cannot be determined.')
213  return None, None
214  else:
215  logging.error('Could not determine the tag boost version.' )
216  return None, None
217  else:
218  if niovs == 0:
219  logging.info('Tag boost version has not changed.')
220  else:
221  msg = 'Found tag boost version %s ( min iov: %s ) combining payloads from %s iovs' %(tagBoostVersion,minIov,niovs)
222  if timeCut is not None:
223  if update:
224  msg += ' (iov insertion time>%s)' %str(timeCut)
225  else:
226  msg += ' (iov insertion time<%s)' %str(timeCut)
227  logging.info( msg )
228  return tagBoostVersion, minIov
229 
230  def validate_boost_version( self, t, timetype, tagBoostVersion ):
231  cursor = self.db.cursor()
232  cursor.execute('SELECT GT.NAME, GT.RELEASE, GT.SNAPSHOT_TIME FROM GLOBAL_TAG GT, GLOBAL_TAG_MAP GTM WHERE GT.NAME = GTM.GLOBAL_TAG_NAME AND GTM.TAG_NAME = :TAG_NAME',(t,))
233  rows = cursor.fetchall()
234  invalid_gts = []
235  ngt = 0
236  gts = []
237  for r in rows:
238  gts.append((r[0],r[1],r[2]))
239  if len(gts)>0:
240  logging.info('validating %s gts.' %len(gts))
241  boost_snapshot_map = {}
242  for gt in gts:
243  ngt += 1
244  logging.debug('Validating for GT %s (release %s)' %(gt[0],gt[1]))
245  gtCMSSWVersion = sm.check_cmssw_version( gt[1] )
246  gtBoostVersion = self.version_db.lookup_boost_in_cmssw( gtCMSSWVersion )
247  if sm.cmp_boost_version( gtBoostVersion, tagBoostVersion )<0:
248  logging.warning( 'The boost version computed from all the iovs in the tag (%s) is incompatible with the gt [%s] %s (consuming ver: %s, snapshot: %s)' %(tagBoostVersion,ngt,gt[0],gtBoostVersion,str(gt[2])))
249  if str(gt[2]) not in boost_snapshot_map.keys():
250  tagSnapshotBoostVersion = None
251  minIov = None
252  tagSnapshotBoostVersion, minIov = self.process_tag_boost_version(t, timetype, tagSnapshotBoostVersion, minIov, gt[2])
253  if tagSnapshotBoostVersion is not None:
254  boost_snapshot_map[str(gt[2])] = tagSnapshotBoostVersion
255  else:
256  continue
257  else:
258  tagSnapshotBoostVersion = boost_snapshot_map[str(gt[2])]
259  if sm.cmp_boost_version( gtBoostVersion, tagSnapshotBoostVersion )<0:
260  logging.error('The snapshot from tag used by gt %s (consuming ver: %s) has an incompatible combined boost version %s' %(gt[0],gtBoostVersion,tagSnapshotBoostVersion))
261  invalid_gts.append( ( gt[0], gtBoostVersion ) )
262  if len(invalid_gts)==0:
263  if ngt>0:
264  logging.info('boost version for the tag validated in %s referencing Gts' %(ngt))
265  else:
266  logging.info('No GT referencing this tag found.')
267  else:
268  logging.error( 'boost version for the tag is invalid.')
269  return invalid_gts
270 
271  def update_tag_boost_version_in_db( self, t, tagBoostVersion, minIov, update ):
272  cursor = self.db.cursor()
273  now = datetime.datetime.utcnow()
274  if update:
275  cursor.execute('UPDATE TAG_METADATA SET MIN_SERIALIZATION_V=:BOOST_V, MIN_SINCE=:MIN_IOV, MODIFICATION_TIME=:NOW WHERE TAG_NAME = :NAME',( tagBoostVersion,minIov,now,t))
276  else:
277  cursor.execute('INSERT INTO TAG_METADATA ( TAG_NAME, MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME ) VALUES ( :NAME, :BOOST_V, :MIN_IOV, :NOW )',(t, tagBoostVersion,minIov,now))
278  logging.info('Minimum boost version for the tag updated.')
279 
280  def update_tags( self ):
281  cursor = self.db.cursor()
282  self.version_db = version_db( self.db )
283  self.version_db.fetch_cmssw_boost_map()
284  self.version_db.fetch_boost_run_map()
285  tags = {}
286  wpars = ()
287  if self.args.name is not None:
288  stmt0 = 'SELECT NAME FROM TAG WHERE NAME = :TAG_NAME'
289  wpars = (self.args.name,)
290  cursor.execute(stmt0,wpars);
291  rows = cursor.fetchall()
292  found = False
293  for r in rows:
294  found = True
295  break
296  if not found:
297  raise Exception('Tag %s does not exists in the database.' %self.args.name )
298  tags[self.args.name] = None
299  stmt1 = 'SELECT MIN_SERIALIZATION_V, MIN_SINCE, CAST(MODIFICATION_TIME AS TIMESTAMP(0)) FROM TAG_METADATA WHERE TAG_NAME = :NAME'
300  cursor.execute(stmt1,wpars);
301  rows = cursor.fetchall()
302  for r in rows:
303  tags[self.args.name] = (r[0],r[1],r[2])
304  else:
305  stmt0 = 'SELECT NAME FROM TAG WHERE NAME NOT IN ( SELECT TAG_NAME FROM TAG_METADATA) ORDER BY NAME'
306  nmax = 100
307  if self.args.max is not None:
308  nmax = self.args.max
309  if self.args.all:
310  nmax = -1
311  if nmax >=0:
312  stmt0 = 'SELECT NAME FROM (SELECT NAME FROM TAG WHERE NAME NOT IN ( SELECT TAG_NAME FROM TAG_METADATA ) ORDER BY NAME) WHERE ROWNUM<= :MAXR'
313  wpars = (nmax,)
314  cursor.execute(stmt0,wpars);
315  rows = cursor.fetchall()
316  for r in rows:
317  tags[r[0]] = None
318  stmt1 = 'SELECT T.NAME NAME, TM.MIN_SERIALIZATION_V MIN_SERIALIZATION_V, TM.MIN_SINCE MIN_SINCE, CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) MODIFICATION_TIME FROM TAG T, TAG_METADATA TM WHERE T.NAME=TM.TAG_NAME AND CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) < (SELECT MAX(INSERTION_TIME) FROM IOV WHERE IOV.TAG_NAME=TM.TAG_NAME) ORDER BY NAME'
319  nmax = nmax-len(tags)
320  if nmax >=0:
321  stmt1 = 'SELECT NAME, MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME FROM (SELECT T.NAME NAME, TM.MIN_SERIALIZATION_V MIN_SERIALIZATION_V, TM.MIN_SINCE MIN_SINCE, CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) MODIFICATION_TIME FROM TAG T, TAG_METADATA TM WHERE T.NAME=TM.TAG_NAME AND CAST(TM.MODIFICATION_TIME AS TIMESTAMP(0)) < (SELECT MAX(INSERTION_TIME) FROM IOV WHERE IOV.TAG_NAME=TM.TAG_NAME) ORDER BY NAME) WHERE ROWNUM<= :MAXR'
322  wpars = (nmax,)
323  cursor.execute(stmt1,wpars);
324  rows = cursor.fetchall()
325  i = 0
326  for r in rows:
327  i += 1
328  if nmax >=0 and i>nmax:
329  break
330  tags[r[0]] = (r[1],r[2],r[3])
331  logging.info( 'Processing boost version for %s tags' %len(tags))
332  count = 0
333  for t in sorted(tags.keys()):
334  count += 1
335  try:
336  update = False
337  cursor.execute('SELECT TIME_TYPE FROM TAG WHERE NAME= :TAG_NAME',(t,))
338  timetype = cursor.fetchone()[0]
339  self.iovs = None
340  logging.info('************************************************************************')
341  logging.info('Tag [%s] %s - timetype: %s' %(count,t,timetype))
342  tagBoostVersion = None
343  minIov = None
344  timeCut = None
345  if tags[t] is not None:
346  update = True
347  tagBoostVersion = tags[t][0]
348  minIov = tags[t][1]
349  timeCut = tags[t][2]
350  tagBoostVersion, minIov = self.process_tag_boost_version( t, timetype, tagBoostVersion, minIov, timeCut, self.args.validate )
351  if tagBoostVersion is None:
352  continue
353  logging.debug('boost versions in the %s iovs: %s' %(len(self.iovs),str(self.versionIovs)))
354  if self.args.validate:
355  invalid_gts = self.validate_boost_version( t, timetype, tagBoostVersion )
356  if len(invalid_gts)>0:
357  with open('invalid_tags_in_gts.txt','a') as error_file:
358  for gt in invalid_gts:
359  error_file.write('Tag %s (boost %s) is invalid for GT %s ( boost %s) \n' %(t,tagBoostVersion,gt[0],gt[1]))
360  if len(self.iovs):
361  if self.iovs[0][0]<minIov:
362  minIov = self.iovs[0]
363  self.update_tag_boost_version_in_db( t, tagBoostVersion, minIov, update )
364  self.db.commit()
365  except Exception as e:
366  logging.error(str(e))
367 
368  def insert_boost_run( self ):
369  cursor = self.db.cursor()
370  self.version_db = version_db( self.db )
371  self.version_db.insert_boost_run_range( self.args.since, self.args.label )
372  self.db.commit()
373  logging.info('boost version %s inserted with since %s' %(self.args.label,self.args.since))
374 
375  def list_boost_run( self ):
376  cursor = self.db.cursor()
377  self.version_db = version_db( self.db )
378  self.version_db.fetch_boost_run_map()
379  headers = ['Run','Run start time','Boost Version','Insertion time']
380  print_table( headers, self.version_db.boost_run_map )
381 
383  cursor = self.db.cursor()
384  tag = self.args.tag_name
385  cursor.execute('SELECT TIME_TYPE FROM TAG WHERE NAME= :TAG_NAME',(tag,))
386  rows = cursor.fetchall()
387  timeType = None
388  t_modificationTime = None
389  for r in rows:
390  timeType = r[0]
391  if timeType is None:
392  raise Exception("Tag %s does not exist in the database." %tag)
393  cursor.execute('SELECT MAX(INSERTION_TIME) FROM IOV WHERE TAG_NAME= :TAG_NAME',(tag,))
394  rows = cursor.fetchall()
395  for r in rows:
396  t_modificationTime = r[0]
397  if t_modificationTime is None:
398  raise Exception("Tag %s does not have any iov stored." %tag)
399  logging.info('Tag %s - timetype: %s' %(tag,timeType))
400  cursor.execute('SELECT MIN_SERIALIZATION_V, MIN_SINCE, MODIFICATION_TIME FROM TAG_METADATA WHERE TAG_NAME= :TAG_NAME',(tag,))
401  rows = cursor.fetchall()
402  tagBoostVersion = None
403  minIov = None
404  v_modificationTime = None
405  for r in rows:
406  tagBoostVersion = r[0]
407  minIov = r[1]
408  v_modificationTime = r[2]
409  if v_modificationTime is not None:
410  if t_modificationTime > v_modificationTime:
411  logging.warning('The minimum boost version stored is out of date.')
412  else:
413  logging.info('The minimum boost version stored is up to date.')
414  mt = '-'
415  if v_modificationTime is not None:
416  mt = str(v_modificationTime)
417  r_tagBoostVersion = None
418  if self.args.rebuild or self.args.full:
419  self.version_db = version_db( self.db )
420  self.version_db.fetch_boost_run_map()
421  timeCut = None
422  logging.info('Calculating minimum boost version for the available iovs...')
423  r_tagBoostVersion, r_minIov = self.process_tag_boost_version( tag, timeType, tagBoostVersion, minIov, timeCut )
424  print('# Currently stored: %s (min iov:%s)' %(tagBoostVersion,minIov))
425  print('# Last update: %s' %mt)
426  print('# Last update on the iovs: %s' %str(t_modificationTime))
427  if self.args.rebuild or self.args.full:
428  print('# Based on the %s available IOVs: %s (min iov:%s)' %(len(self.iovs),r_tagBoostVersion,r_minIov))
429  if self.args.full:
430  headers = ['Run','Boost Version']
431  print_table( headers, self.versionIovs )
432 
433 import optparse
434 import argparse
435 
436 def main():
437  tool = conddb_tool()
438  parser = argparse.ArgumentParser(description='CMS conddb command-line tool for serialiation metadata. For general help (manual page), use the help subcommand.')
439  parser.add_argument('--db', type=str, help='The target database: pro ( for prod ) or dev ( for prep ). default=pro')
440  parser.add_argument("--auth","-a", type=str, help="The path of the authentication file")
441  parser.add_argument('--verbose', '-v', action='count', help='The verbosity level')
442  parser_subparsers = parser.add_subparsers(title='Available subcommands')
443  parser_update_tags = parser_subparsers.add_parser('update_tags', description='Update the existing tag headers with the boost version')
444  parser_update_tags.add_argument('--name', '-n', type=str, help='Name of the specific tag to process (default=None - in this case all of the tags will be processed.')
445  parser_update_tags.add_argument('--max', '-m', type=int, help='the maximum number of tags processed',default=100)
446  parser_update_tags.add_argument('--all',action='store_true', help='process all of the tags with boost_version = None')
447  parser_update_tags.add_argument('--validate',action='store_true', help='validate the tag/boost version under processing')
448  parser_update_tags.set_defaults(func=tool.update_tags,accessType='w')
449  parser_insert_boost_version = parser_subparsers.add_parser('insert', description='Insert a new boost version range in the run map')
450  parser_insert_boost_version.add_argument('--label', '-l',type=str, help='The boost version label',required=True)
451  parser_insert_boost_version.add_argument('--since', '-s',type=int, help='The since validity (run number)',required=True)
452  parser_insert_boost_version.set_defaults(func=tool.insert_boost_run,accessType='w')
453  parser_list_boost_versions = parser_subparsers.add_parser('list', description='list the boost versions in the run map')
454  parser_list_boost_versions.set_defaults(func=tool.list_boost_run,accessType='r')
455  parser_show_version = parser_subparsers.add_parser('show_tag', description='Display the minimum boost version for the specified tag (the value stored, by default)')
456  parser_show_version.add_argument('tag_name',help='The name of the tag')
457  parser_show_version.add_argument('--rebuild','-r',action='store_true',default=False,help='Re-calculate the minimum boost versio ')
458  parser_show_version.add_argument('--full',action='store_true',default=False,help='Recalulate the minimum boost version, listing the versions in the iov sequence')
459  parser_show_version.set_defaults(func=tool.show_tag_boost_version,accessType='r')
460  args = parser.parse_args()
461  tool.args = args
462  if args.verbose >=1:
463  tool.logger.setLevel(logging.DEBUG)
464  tool.connect()
465  return args.func()
466  else:
467  try:
468  tool.connect()
469  sys.exit( args.func())
470  except Exception as e:
471  logging.error(e)
472  sys.exit(1)
473 
474 if __name__ == '__main__':
475  main()
def print_table(headers, table)
def lookup_boost_in_cmssw(self, cmssw_version)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def insert_cmssw_boost(self, cmssw_version, boost_version)
def validate_boost_version(self, t, timetype, tagBoostVersion)
def insert_boost_run_range(self, run, boost_version)
Definition: main.py:1
#define str(s)
def process_tag_boost_version(self, t, timetype, tagBoostVersion, minIov, timeCut, validate)
def update_tag_boost_version_in_db(self, t, tagBoostVersion, minIov, update)