different approach to disabling modules
paulfantom committed
Jun 13, 2016 at 10:55 UTC
ab359f3da7d5360f26a45f0aefb6912518852963
1 file changed
+6
-5
plugins.d/python.d.plugin
+6
-5
@@ -326,10 +326,11 @@ def run():
326
DEBUG_FLAG = bool(conf['debug'])
327
except (KeyError, TypeError):
328
pass
329
- try:
330
- disabled = conf['disabled'].split(',')
331
- except (KeyError):
332
- pass
329
+ for k, v in conf.items():
330
+ if k in ("plugins_config_dir", "plugins_dir", "interval", "debug"):
331
+ continue
332
+ if v == 'no':
333
+ disabled.append(k)
334
except FileNotFoundError:
335
modules_conf = config_dir
336
modules_dir = main_dir.replace("plugins.d", "python.d")
@@ -345,7 +346,7 @@ def run():
346
modules = out['modules']
347
if out['interval'] is not None:
348
interval = out['interval']
348
-
349
+
350
# configure environement to run modules
351
sys.path.append(modules_dir+"python_modules") # append path to directory with modules dependencies
352