move all `url` variables from SimpleService to UrlService
paulfantom committed
Jun 30, 2016 at 18:31 UTC
ec0c01769a579a59e8a85c4c66282415cf6b143d
1 file changed
+19
-20
python.d/python_modules/base.py
+19
-20
@@ -299,7 +299,6 @@ class SimpleService(BaseService):
299
def __init__(self, configuration=None, name=None):
300
self.order = []
301
self.definitions = {}
302
- self.url = ""
302
BaseService.__init__(self, configuration=configuration, name=name)
303
304
def _get_data(self):
@@ -316,25 +315,6 @@ class SimpleService(BaseService):
315
"""
316
return {}
317
319
- def check(self):
320
- """
321
- Format configuration data and try to connect to server
322
- :return: boolean
323
- """
324
- if self.name is None or self.name == str(None):
325
- self.name = 'local'
326
- else:
327
- self.name = str(self.name)
328
- try:
329
- self.url = str(self.configuration['url'])
330
- except (KeyError, TypeError):
331
- pass
332
-
333
- if self._formatted_data() is not None:
334
- return True
335
- else:
336
- return False
337
-
318
def create(self):
319
"""
320
Create charts
@@ -409,3 +389,22 @@ class UrlService(SimpleService):
389
except:
390
pass
391
return raw
392
+
393
+ def check(self):
394
+ """
395
+ Format configuration data and try to connect to server
396
+ :return: boolean
397
+ """
398
+ if self.name is None or self.name == str(None):
399
+ self.name = 'local'
400
+ else:
401
+ self.name = str(self.name)
402
+ try:
403
+ self.url = str(self.configuration['url'])
404
+ except (KeyError, TypeError):
405
+ pass
406
+
407
+ if self._formatted_data() is not None:
408
+ return True
409
+ else:
410
+ return False