gnocchi: log on warning level, not exception

Logging with exception is an error level and is a bit violent,
considering error based on missing overlap can regularly happen. Having
warning as level is largely enough. No need to scare people.

Change-Id: Ib9581a6104d41f2cedbf00d085b8a46b15ceccbe
This commit is contained in:
Julien Danjou 2016-05-13 14:30:34 +02:00
parent bcaee09b9e
commit e7c1108e9a

View File

@ -18,7 +18,7 @@ from oslo_log import log
from oslo_serialization import jsonutils
from aodh.evaluator import threshold
from aodh.i18n import _
from aodh.i18n import _LW
from aodh import keystone_client
LOG = log.getLogger(__name__)
@ -61,8 +61,9 @@ class GnocchiResourceThresholdEvaluator(GnocchiBase):
start=start, stop=end,
resource_id=rule['resource_id'],
aggregation=rule['aggregation_method'])
except Exception:
LOG.exception(_('alarm stats retrieval failed'))
except Exception as e:
LOG.warning(_LW('alarm stats retrieval failed: %s'),
e)
return []
@ -73,8 +74,8 @@ class GnocchiAggregationMetricsThresholdEvaluator(GnocchiBase):
metrics=rule['metrics'],
start=start, stop=end,
aggregation=rule['aggregation_method'])
except Exception:
LOG.exception(_('alarm stats retrieval failed'))
except Exception as e:
LOG.warning(_LW('alarm stats retrieval failed: %s'), e)
return []
@ -97,6 +98,6 @@ class GnocchiAggregationResourcesThresholdEvaluator(GnocchiBase):
aggregation=rule['aggregation_method'],
needed_overlap=0,
)
except Exception:
LOG.exception(_('alarm stats retrieval failed'))
except Exception as e:
LOG.warning(_LW('alarm stats retrieval failed: %s'), e)
return []