Warning, /CondCore/Utilities/scripts/popconRun is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python3
0002 '''Script that directs the popcon output to the condition uploader
0003 '''
0004 import os
0005 import sys
0006 from CondCore.Utilities import popcon2dropbox
0007
0008 import optparse
0009 import argparse
0010
0011 def main( argv ):
0012
0013 parser = argparse.ArgumentParser()
0014 parser.add_argument("job_file", type=str, help="wrapper for popcon jobs")
0015 parser.add_argument("-d","--destDb", type=str, help="destination database")
0016 parser.add_argument("-t","--destTag", type=str, help="destination database")
0017 parser.add_argument("-a","--auth", type=str, help="authentication path (for conddb key and .netrc files)")
0018 parser.add_argument("-x","--comment", type=str, help="user comment for the upload")
0019 parser.add_argument('--copy', '-c', action='store_true', help='Execute the import with a direct copy.')
0020 args = parser.parse_args()
0021
0022 if args.job_file is None:
0023 print('ERROR: the cfg file name has not been provided.')
0024 return -1
0025 if not os.path.exists( args.job_file ):
0026 print('ERROR: the specified cfg file %s has not been found in the execution directory' %args.job_file)
0027 return -2
0028 if args.destDb is None:
0029 print('ERROR: the destination database has not been provided.')
0030 return -1
0031 if args.destTag is None:
0032 print('ERROR: the destination tag has not been provided.')
0033 return -1
0034
0035 return popcon2dropbox.run( args )
0036
0037 if __name__ == '__main__':
0038 sys.exit(main(sys.argv))
0039
0040