]> arthur.barton.de Git - netdata.git/commitdiff
check if modules provided by cli param exist
authorpaulfantom <paulfantom@gmail.com>
Sat, 11 Jun 2016 19:03:57 +0000 (21:03 +0200)
committerpaulfantom <paulfantom@gmail.com>
Sat, 11 Jun 2016 19:03:57 +0000 (21:03 +0200)
plugins.d/python.d.plugin

index c497968b023107e135dd9807989a2f40b2e596a0..e59bc3af9c8a11ceb4a91b5a8d6ee5880ea1c443 100755 (executable)
@@ -35,9 +35,13 @@ class PythonCharts(object):
         self.modules = []
         if len(modules) > 0:
             for m in modules:
-                self.modules.append(
-                    self.import_plugin(
-                        modules_path + m + ".chart.py"))
+                mod = self.import_plugin(modules_path + m + ".chart.py")
+                if mod is not None:
+                    self.modules.append(mod)
+            if len(self.modules) == 0:
+                debug("cannot find provided module(s)", modules_path)
+                sys.stdout.write("DISABLE\n")
+                sys.exit(1)
         else:
             self.load_modules(modules_path)
             if len(self.modules) == 0: