Fix collectd_openstack.py for None values
Change-Id: I6338d0029da09add66c5ebed92ab452bbccac556 Co-Authored-By: Simon Pasquier <spasquier@mirantis.com>
This commit is contained in:
parent
a57116a448
commit
2b9dc19865
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue