resource_id=resource_id)
if measures:
value = measures[-1][2]
- except (gnocchiclient.exceptions.NotFound, TypeError) as e:
+ except (gnocchiclient.exceptions.NotFound, gnocchiclient.exceptions.BadRequest, TypeError) as e:
# CPU metric in previous Openstack versions do not support rate:mean aggregation method
- # Gnocchi in some Openstack versions raise TypeError instead of NotFound
+ # Gnocchi in some Openstack versions raise TypeError instead of NotFound or BadRequest
if openstack_metric_name == "cpu":
log.debug("No metric %s found for instance %s: %s", openstack_metric_name, resource_id, e)
log.info("Retrying to get metric %s for instance %s without aggregation",