From 977d3a526494bbbc61960615976605d1c2050ddf Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Fri, 19 Jun 2009 06:54:06 +1000 Subject: [PATCH] Switch from MySQL to PostgreSQL. Rah! --- controller-service | 9 ++++----- services/master/database.py | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/controller-service b/controller-service index a383824..899053a 100755 --- a/controller-service +++ b/controller-service @@ -37,14 +37,13 @@ import services.config as config class Controller(pb.Root): def service_setup(self): - self.connection_type = "MySQLdb" + self.connection_type = "pyPgSQL.PgSQL" self.connection_dict = dict(cp_reconnect=True, host=config.get("db", "host"), user=config.get("db", "user"), - passwd=config.get("db", "passwd"), - db=config.get("db", "db"), - port=config.getint("db", "port"), - charset="utf8") + password=config.get("db", "passwd"), + database=config.get("db", "db"), + port=config.getint("db", "port")) self.sm = ServiceManager() self.dcm = DatabaseCommandManager() diff --git a/services/master/database.py b/services/master/database.py index 83f4260..ab7c7eb 100644 --- a/services/master/database.py +++ b/services/master/database.py @@ -55,11 +55,11 @@ class DatabaseManager: Start up the connection to the database. """ if self.db is None: - self.db = adbapi.ConnectionPool("MySQLdb", cp_reconnect=True, + self.db = adbapi.ConnectionPool("pyPgSQL.PgSQL", cp_reconnect=True, host=config.get("db", "host"), user=config.get("db", "user"), - passwd=config.get("db", "passwd"), - db=config.get("db", "db"), + password=config.get("db", "passwd"), + database=config.get("db", "db"), port=config.getint("db", "port")) def stop(self): -- 2.30.2