better handling of lacking 3rd party libs
paulfantom committed
Jun 18, 2016 at 19:36 UTC
c3459e5ea76cae97eeb50b65472ea19e0b4efdbb
1 file changed
+2
-3
python.d/mysql.chart.py
+2
-3
@@ -4,8 +4,6 @@
4
NAME = "mysql.chart.py"
5
import sys
6
7
-sys.path.append("./python_modules") #FIXME it is here for debug only
8
-
7
# import 3rd party library to handle MySQL communication
8
try:
9
import MySQLdb
@@ -17,7 +15,8 @@ except ImportError:
15
# https://github.com/PyMySQL/PyMySQL
16
sys.stderr.write(NAME + ": using pymysql\n")
17
except ImportError:
20
- sys.stderr.write(NAME + ": You need to install PyMySQL module to use mysql.chart.py plugin\n")
18
+ sys.stderr.write(NAME + ": You need to install MySQLdb or PyMySQL module to use mysql.chart.py plugin\n")
19
+ raise ImportError
20
21
from base import BaseService
22