Skip to content
Snippets Groups Projects
Commit 65449f6c authored by Jean-Baptiste De Vivie De Regie's avatar Jean-Baptiste De Vivie De Regie
Browse files

Merge branch 'pyAMIexception_24.0' into '24.0'

PyJobTransforms.trfAMI: fix handling of pyAMI.exception.Error exceptions

See merge request atlas/athena!76577
parents 7c6d5cb4 290fb66c
No related branches found
No related tags found
No related merge requests found
......@@ -429,10 +429,10 @@ def getTrfConfigFromAMI(tag, suppressNonJobOptions = True):
except pyAMI.exception.Error as e:
msg.warning('An exception occured when connecting to primary AMI: {0}'.format(e))
msg.debug('Exception: {0}'.format(e))
if 'please login' in e.message or 'certificate expired' in e.message:
if 'please login' in str(e) or 'certificate expired' in str(e):
raise TransformAMIException(AMIerrorCode, 'Getting tag info from AMI failed with credential problem. '
'Please check your AMI account status.')
if 'Invalid amiTag' in e.message:
if 'Invalid amiTag' in str(e):
raise TransformAMIException(AMIerrorCode, 'Invalid AMI tag ({0}).'.format(tag))
msg.debug("Error may not be fatal - will try AMI replica catalog")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment