]> arthur.barton.de Git - netdata.git/commitdiff
different approach to disabling modules
authorpaulfantom <paulfantom@gmail.com>
Mon, 13 Jun 2016 08:55:28 +0000 (10:55 +0200)
committerpaulfantom <paulfantom@gmail.com>
Mon, 13 Jun 2016 08:55:28 +0000 (10:55 +0200)
plugins.d/python.d.plugin

index 5e928b3f4e62d97c284998d5bcb22ed840d07153..2521d425ba3319ca870181bbb656521b2ce05da2 100755 (executable)
@@ -326,10 +326,11 @@ def run():
             DEBUG_FLAG = bool(conf['debug'])
         except (KeyError, TypeError):
             pass
-        try:
-            disabled = conf['disabled'].split(',')
-        except (KeyError):
-            pass
+        for k, v in conf.items():
+            if k in ("plugins_config_dir", "plugins_dir", "interval", "debug"):
+                continue
+            if v == 'no':
+                disabled.append(k)
     except FileNotFoundError:
         modules_conf = config_dir
         modules_dir = main_dir.replace("plugins.d", "python.d")
@@ -345,7 +346,7 @@ def run():
     modules = out['modules']
     if out['interval'] is not None:
         interval = out['interval']
-
+    
     # configure environement to run modules
     sys.path.append(modules_dir+"python_modules") # append path to directory with modules dependencies