Skip to content

Commit

Permalink
Merge pull request #23 from mk-fg/collectd_converter_null_name_fix
Browse files Browse the repository at this point in the history
Handle None returned from collectd metric name converter correctly
  • Loading branch information
trbs committed Feb 17, 2014
2 parents 5e208f2 + a9b07a1 commit 0d00ebd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bucky/collectd.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ def convert(self, sample):
default = self.converters["_default"]
handler = self.converters.get(sample["plugin"], default)
try:
name = '.'.join(handler(sample))
if name is None:
name_parts = handler(sample)
if name_parts is None:
return # treat None as "ignore sample"
name = '.'.join(name_parts)
except:
log.exception("Exception in sample handler %s (%s):", sample["plugin"], handler)
return
Expand Down

0 comments on commit 0d00ebd

Please sign in to comment.