18 parser = argparse.ArgumentParser(argument_default = argparse.SUPPRESS, description = 'GetTfCommand.py - prints the job transform commands accociated with an AMI tag.')
19 parser.add_argument('--AMI', '--AMIConfig', help = 'Production tag to be interpreted', required = True)
20 parser.add_argument('--verbose', '--debug', action = 'store_true', help = 'set logging level to DEBUG')
21 parser.add_argument('--doNotSuppressNonJobOptions', action = 'store_true', help = 'get full output from AMI')
22 parser.add_argument('--printOnlyCmdLine', action = 'store_true', help = 'simply put out the TRF command line, nothing else')
23
24 args = vars(parser.parse_args(sys.argv[1:]))
25
26if'verbose'in args:
27 msg.setLevel(stdLogLevels['DEBUG'])
28
29 suppressNonJobOptions = True
30if'doNotSuppressNonJobOptions'in args:
31 suppressNonJobOptions = False
32
33try:
34 tag = TagInfo(args['AMI'], suppressNonJobOptions)
35except TransformAMIException as e:
36print('An AMI exception was raised when trying to resolve the tag {0}.'.format(args['AMI']))
38print('Note that you need both suitable credentials to access AMI and access to the panda database (only works from inside CERN) for GetTfCommand.py to work.')