Skip to content
Snippets Groups Projects
Commit 9ca36777 authored by Alaettin Serhan Mete's avatar Alaettin Serhan Mete :eagle: Committed by Frank Winklmeier
Browse files

PyJobTransforms: Fix for ATLINFR-3411

parent a6dcfdf5
No related branches found
No related tags found
No related merge requests found
...@@ -223,19 +223,18 @@ class TagInfo(object): ...@@ -223,19 +223,18 @@ class TagInfo(object):
## @brief Get an AMI client ## @brief Get an AMI client
# @note Always return a client to the primary replica. # @note Always return a client to the primary replica.
# The caller is allowed to update the replica via the # The caller is allowed to update the replica via the
# config.endpoint value. # config.endpoints value.
# @returns pyAMI.client.Client instance # @returns pyAMI.client.Client instance
def getAMIClient(): def getAMIClient(endpoints = ['atlas-replica','atlas']):
msg.debug('Getting AMI client...') msg.debug('Getting AMI client...')
endpoint = 'atlas'
try: try:
from pyAMI.client import Client from pyAMI.client import Client
except ImportError: except ImportError:
raise TransformAMIException(AMIerrorCode, 'Import of pyAMI modules failed.') raise TransformAMIException(AMIerrorCode, 'Import of pyAMI modules failed.')
msg.debug("Attempting to get AMI client for endpoint {0}".format(endpoint)) msg.debug("Attempting to get AMI client for endpoints {0}".format(endpoints))
amiclient = Client(endpoint, ignore_proxy = True) amiclient = Client(endpoints, ignore_proxy = True)
return amiclient return amiclient
## @brief Get list of characters of ProdSys tags ## @brief Get list of characters of ProdSys tags
...@@ -444,14 +443,6 @@ def getTrfConfigFromAMI(tag, suppressNonJobOptions = True): ...@@ -444,14 +443,6 @@ def getTrfConfigFromAMI(tag, suppressNonJobOptions = True):
raise TransformAMIException(AMIerrorCode, 'Invalid AMI tag ({0}).'.format(tag)) raise TransformAMIException(AMIerrorCode, 'Invalid AMI tag ({0}).'.format(tag))
msg.debug("Error may not be fatal - will try AMI replica catalog") msg.debug("Error may not be fatal - will try AMI replica catalog")
try:
amiclient.config.endpoint = 'atlas-replica'
# result = pyAMI.atlas.api.get_ami_tag(amiclient, tag)
result = get_ami_tag(amiclient, tag, suppressNonJobOptions)
except pyAMI.exception.Error as e:
msg.error('An exception occured when connecting to the AMI replica catalog: {0}'.format(e))
raise TransformAMIException(AMIerrorCode, 'Getting tag info from AMI failed (tried both primary and replica). '
'See logfile for exception details.')
try: try:
trf = TrfConfig() trf = TrfConfig()
......
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