Merge "Ignore Gnocchi API error when the metric is not yet created" into stable/ussuri

This commit is contained in:
Zuul 2022-12-21 17:28:33 +00:00 committed by Gerrit Code Review
commit 4366d6eae1
1 changed files with 4 additions and 1 deletions

View File

@ -217,7 +217,10 @@ class AggregationMetricByResourcesLookupRule(AlarmGnocchiThresholdRule):
if e.code == 404:
# NOTE(sileht): We are fine here, we just want to ensure the
# 'query' payload is valid for Gnocchi If the metric
# doesn't exists yet, it doesn't matter
# doesn't exists yet, it doesn't matter.
return
if e.code == 400 and 'Metrics not found' in e.message["cause"]:
# NOTE(tkajinam): Gnocchi<4.5 returns 400 instead of 404
return
raise base.ClientSideError(e.message, status_code=e.code)
except Exception as e: