diff --git a/backend/extractionSteps/maturityAssessment/apm/BackendsAPM.py b/backend/extractionSteps/maturityAssessment/apm/BackendsAPM.py index 9cf2b35..0689128 100644 --- a/backend/extractionSteps/maturityAssessment/apm/BackendsAPM.py +++ b/backend/extractionSteps/maturityAssessment/apm/BackendsAPM.py @@ -116,11 +116,20 @@ def analyze(self, controllerData, thresholds): analysisDataEvaluatedMetrics["percentBackendsWithLoad"] = 0 # backendLimitNotHit - backendLimit = int( - next( - iter([configuration for configuration in hostInfo["configurations"] if configuration["name"] == "backend.registration.limit"]) - )["value"] - ) + try: + backendLimit = int( + next( + iter([configuration for configuration in hostInfo["configurations"] if configuration["name"] == "backend.registration.limit"]) + )["value"] + ) + except StopIteration: + logging.warning(f'{hostInfo["controller"].host} - ' + f'backend.registration.limit ' + f'configuration not found for' + f' {application["name"]}. Use default.') + # set to default if api not returning + backendLimit = 500000 + analysisDataEvaluatedMetrics["backendLimitNotHit"] = len(application["backends"]) <= backendLimit # numberOfCustomBackendRules