diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-03-16 07:50:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-03-16 07:50:45 +0000 |
commit | 87cce1817d03daca8c31be82d781ec47a4560087 (patch) | |
tree | 06cb3e407ea32dcc385cbe4fb77e251e34bc1e68 /collectors/python.d.plugin/unbound/unbound.chart.py | |
parent | Releasing debian version 1.12.2-2. (diff) | |
download | netdata-87cce1817d03daca8c31be82d781ec47a4560087.tar.xz netdata-87cce1817d03daca8c31be82d781ec47a4560087.zip |
Merging upstream version 1.13.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/unbound/unbound.chart.py')
-rw-r--r-- | collectors/python.d.plugin/unbound/unbound.chart.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/collectors/python.d.plugin/unbound/unbound.chart.py b/collectors/python.d.plugin/unbound/unbound.chart.py index adb58d417..dade2b204 100644 --- a/collectors/python.d.plugin/unbound/unbound.chart.py +++ b/collectors/python.d.plugin/unbound/unbound.chart.py @@ -9,7 +9,7 @@ import sys from copy import deepcopy from bases.FrameworkServices.SocketService import SocketService -from bases.loaders import YamlOrderedLoader +from bases.loaders import load_config PRECISION = 1000 @@ -169,7 +169,7 @@ def _get_perthread_info(thread): for key, value in PER_THREAD_STAT_MAP.items(): statmap[key.format(shortname=sname)] = (value[0].format(shortname=sname), value[1]) - return (charts, order, statmap) + return charts, order, statmap class Service(SocketService): @@ -205,7 +205,11 @@ class Service(SocketService): def _auto_config(self): if self.ubconf and os.access(self.ubconf, os.R_OK): self.debug('Unbound config: {0}'.format(self.ubconf)) - conf = YamlOrderedLoader.load_config_from_file(self.ubconf)[0] + conf = dict() + try: + conf = load_config(self.ubconf) + except Exception as error: + self.error("error on loading '{0}' : {1}".format(self.ubconf, error)) if self.ext is None: if 'extended-statistics' in conf['server']: self.ext = conf['server']['extended-statistics'] |