Fix collectd_openstack.py for None values
diff --git a/collectd/files/plugin/collectd_openstack.py b/collectd/files/plugin/collectd_openstack.py
index 5539338..955d780 100644
--- a/collectd/files/plugin/collectd_openstack.py
+++ b/collectd/files/plugin/collectd_openstack.py
@@ -345,5 +345,9 @@
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