Fix missing Elasticsearch metrics

When the metric's value was 0, it was skipped by the collectd plugin.

Change-Id: I5d9adf51c38c2cf24dfc37a0992a26f3bd8baa00
Closes-Bug: #1568814
(cherry picked from commit 2136cc8d4b)
This commit is contained in:
Simon Pasquier 2016-04-11 13:36:27 +02:00
parent d9ffece249
commit 934fd4506a
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ class ElasticsearchClusterHealthPlugin(base.Base):
}
for metric in METRICS:
value = data.get(metric)
if not value:
if value is None:
# Depending on the Elasticsearch version, not all metrics are
# available
self.logger.info("Couldn't find {} metric".format(metric))