]> arthur.barton.de Git - netdata.git/commitdiff
prevent breaking everything
authorpaulfantom <paulfantom@gmail.com>
Sun, 12 Jun 2016 12:25:45 +0000 (14:25 +0200)
committerpaulfantom <paulfantom@gmail.com>
Sun, 12 Jun 2016 12:28:15 +0000 (14:28 +0200)
plugins.d/python.d.plugin

index c7ef06b3080e3b971e6b425a91a7609e6da84c0e..9e7c33ab80a429e6705dcb51b5cfa5cea67be28e 100755 (executable)
@@ -178,7 +178,7 @@ class PythonCharts(object):
         except AttributeError:
             self.disable_module(mod, "no update")
             return
-        except UnboundLocalError:
+        except (UnboundLocalError, Exception):
             self.disable_module(mod, "misbehaving")
             return
         t_end = time.time()
@@ -201,7 +201,14 @@ class PythonCharts(object):
             next_runs = []
             for mod in self.modules:
                 self.update_module(mod)
-                next_runs.append(self.timetable[mod.__name__]['next'])
+                try:
+                    next_runs.append(self.timetable[mod.__name__]['next'])
+                except KeyError:
+                    pass
+            if len(next_runs) == 0:
+                debug("No plugins loaded")
+                sys.stdout.write("DISABLE\n")
+                sys.exit(1)
             time.sleep(min(next_runs) - time.time())