Fix list rpc: use mysql host from platal.conf
authorMathieu Goulin <mathieu.goulin@gadz.org>
Fri, 9 Sep 2011 12:18:11 +0000 (12:18 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 9 Sep 2011 15:30:01 +0000 (17:30 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
bin/lists.rpc.py

index 843f7c0..61aac8f 100755 (executable)
@@ -69,6 +69,7 @@ def get_config(sec, val, default=None):
 
 MYSQL_USER     = get_config('Core', 'dbuser')
 MYSQL_PASS     = get_config('Core', 'dbpwd')
+MYSQL_HOST     = get_config('Core', 'dbhost')
 MYSQL_DB       = get_config('Core', 'dbdb')
 
 PLATAL_DOMAIN  = get_config('Mail', 'domain')
@@ -167,7 +168,7 @@ def connectDB():
             db=MYSQL_DB,
             user=MYSQL_USER,
             passwd=MYSQL_PASS,
-            unix_socket='/var/run/mysqld/mysqld.sock')
+            host=MYSQL_HOST)
     db.ping()
     db.autocommit(True)
     return db.cursor()