summaryrefslogtreecommitdiffstats
path: root/python.d/retroshare.chart.py
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /python.d/retroshare.chart.py
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
Diffstat (limited to '')
-rw-r--r--python.d/retroshare.chart.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/python.d/retroshare.chart.py b/python.d/retroshare.chart.py
index 0c97973f6..8c0330ec6 100644
--- a/python.d/retroshare.chart.py
+++ b/python.d/retroshare.chart.py
@@ -2,9 +2,10 @@
# Description: RetroShare netdata python.d module
# Authors: sehraf
-from base import UrlService
import json
+from bases.FrameworkServices.UrlService import UrlService
+
# default module values (can be overridden per job in `config`)
# update_every = 2
priority = 60000
@@ -38,10 +39,7 @@ CHARTS = {
class Service(UrlService):
def __init__(self, configuration=None, name=None):
UrlService.__init__(self, configuration=configuration, name=name)
- try:
- self.baseurl = str(self.configuration['url'])
- except (KeyError, TypeError):
- self.baseurl = 'http://localhost:9090'
+ self.baseurl = self.configuration.get('url', 'http://localhost:9090')
self.order = ORDER
self.definitions = CHARTS
@@ -55,7 +53,7 @@ class Service(UrlService):
parsed = json.loads(raw)
if str(parsed['returncode']) != 'ok':
return None
- except:
+ except (TypeError, ValueError):
return None
return parsed['data'][0]