From: Benjamin Diaz Date: Thu, 9 May 2019 19:40:38 +0000 (-0300) Subject: Adds handling of exception inside OpenStack collector X-Git-Tag: v6.0.0~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F7452%2F1;p=osm%2FMON.git Adds handling of exception inside OpenStack collector Change-Id: I9756bef185a3f9495a2ffe737bf5b8326a7e8af6 Signed-off-by: Benjamin Diaz --- diff --git a/osm_mon/collector/vnf_collectors/openstack.py b/osm_mon/collector/vnf_collectors/openstack.py index c11f63f..f32fb9d 100644 --- a/osm_mon/collector/vnf_collectors/openstack.py +++ b/osm_mon/collector/vnf_collectors/openstack.py @@ -113,10 +113,14 @@ class OpenstackCollector(BaseVimCollector): "Was it recently deleted?", vdur['name'], vnf_member_index, nsr_id) continue - value = self.backend.collect_metric(metric_type, openstack_metric_name, resource_id, interface_name) - if value is not None: - metric = VnfMetric(nsr_id, vnf_member_index, vdur['name'], metric_name, value) - metrics.append(metric) + try: + value = self.backend.collect_metric(metric_type, openstack_metric_name, resource_id, + interface_name) + if value is not None: + metric = VnfMetric(nsr_id, vnf_member_index, vdur['name'], metric_name, value) + metrics.append(metric) + except Exception: + log.exception("Error collecting metric %s for vdu %s" % (metric_name, vdur['name'])) return metrics def _get_backend(self, vim_account_id: str):