gnocchi.py (aodh-14.0.0) | : | gnocchi.py (aodh-15.0.0) | ||
---|---|---|---|---|
skipping to change at line 216 | skipping to change at line 216 | |||
], | ], | |||
search=query, | search=query, | |||
needed_overlap=0, | needed_overlap=0, | |||
start="-1 day", | start="-1 day", | |||
stop="now", | stop="now", | |||
resource_type=rule.resource_type) | resource_type=rule.resource_type) | |||
except exceptions.ClientException as e: | except exceptions.ClientException as e: | |||
if e.code == 404: | if e.code == 404: | |||
# NOTE(sileht): We are fine here, we just want to ensure the | # NOTE(sileht): We are fine here, we just want to ensure the | |||
# 'query' payload is valid for Gnocchi If the metric | # '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 | return | |||
raise base.ClientSideError(e.message, status_code=e.code) | raise base.ClientSideError(e.message, status_code=e.code) | |||
except Exception as e: | except Exception as e: | |||
raise GnocchiUnavailable(e) | raise GnocchiUnavailable(e) | |||
class AggregationMetricsByIdLookupRule(AlarmGnocchiThresholdRule): | class AggregationMetricsByIdLookupRule(AlarmGnocchiThresholdRule): | |||
metrics = wsme.wsattr([wtypes.text], mandatory=True) | metrics = wsme.wsattr([wtypes.text], mandatory=True) | |||
"A list of metric Ids" | "A list of metric Ids" | |||
def as_dict(self): | def as_dict(self): | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added |