]> arthur.barton.de Git - netdata.git/commitdiff
disable python plugins if python < 3.1
authorpaulfantom <paulfantom@gmail.com>
Sat, 11 Jun 2016 15:03:08 +0000 (17:03 +0200)
committerpaulfantom <paulfantom@gmail.com>
Sat, 11 Jun 2016 15:03:08 +0000 (17:03 +0200)
plugins.d/python.d.plugin

index 59c6f6ffc15c250de34a420625d6406cad7f0d53..b14f3dd5fe5a973c5f9aa8fa411510820fd07082 100755 (executable)
@@ -3,8 +3,17 @@
 import os
 import sys
 import time
-import importlib.machinery
-import configparser
+#import configparser
+#import importlib.machinery
+try:
+    assert sys.version_info >= (3,1)
+    import configparser
+    import importlib.machinery
+except AssertionError:
+    sys.stderr.write('Not supported python version. Needed python >= 3.1\n')
+    sys.stdout.write('DISABLE\n')
+    sys.exit(1)
+
 
 class PythonCharts(object):