Fix cloudkitty exception handling from gnocchiclient

Probably due six removal, exception handling from gnocchiclient
in cloudkitty is not working as expected.

This patch fixing this issue.

Bug described in storyboard:
https://storyboard.openstack.org/#!/story/2008985

Story: 2008985
Task: 42635
Change-Id: I387fee79d277daa4c739297f1734dad1eaf4cc94
(cherry picked from commit 302f3c89ae)
This commit is contained in:
Michal Arbet
2021-06-21 15:27:10 +02:00
committed by Pierre Riteau
parent 1e964bdfd1
commit 875cacdd46

View File

@@ -319,7 +319,7 @@ class GnocchiCollector(collector.BaseCollector):
# FIXME(peschk_l): gnocchiclient seems to be raising a BadRequest
# when it should be raising MetricNotFound
if isinstance(e, gexceptions.BadRequest):
if 'Metrics not found' not in e.args[0]:
if 'Metrics not found' not in e.message["cause"]:
raise
LOG.warning('[{scope}] Skipping this metric for the '
'current cycle.'.format(scope=project_id, err=e))