Merge "Fix collectd_openstack.py for None values"

This commit is contained in:
Jenkins 2017-01-10 15:40:11 +00:00 committed by Gerrit Code Review
commit 4c8a0284a4
1 changed files with 5 additions and 1 deletions

View File

@ -345,5 +345,9 @@ class CollectdPlugin(base.Base):
counts = defaultdict(int)
for obj in list_object:
s = group_by_func(obj)
counts[s] += count_func(obj) if count_func else 1
try:
counts[s] += count_func(obj) if count_func else 1
except TypeError:
# Ignore when count_func() doesn't return a number
pass
return counts