From b26be28df9fd4db2106cc2a557966c9d2a7345d9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 16 Mar 2019 08:50:20 +0100 Subject: Adding upstream version 1.13.0. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/unbound/unbound.chart.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'collectors/python.d.plugin/unbound/unbound.chart.py') 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'] -- cgit v1.2.3