only give extra_args if there is something to be fed (breaks some db connectors otherwise) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 22 Dec 2009 13:43:24 +0100
branchstable
changeset 4179 3a0b2f14e17b
parent 4178 0441165c7e59
child 4180 9fb0d06926cc
only give extra_args if there is something to be fed (breaks some db connectors otherwise)
server/sqlutils.py
--- a/server/sqlutils.py	Tue Dec 22 11:07:07 2009 +0100
+++ b/server/sqlutils.py	Tue Dec 22 13:43:24 2009 +0100
@@ -157,11 +157,14 @@
         else:
             self.info('connecting to %s@%s', self.dbname,
                       self.dbhost or 'localhost')
+        extra = {}
+        if self.dbdriver_extra_args:
+            extra = {'extra_args': self.dbdriver_extra_args}
         cnx = self.dbapi_module.connect(self.dbhost, self.dbname,
                                         user or self.dbuser,
                                         password or self.dbpasswd,
                                         port=self.dbport,
-                                        extra_args=self.dbdriver_extra_args)
+                                        **extra)
         init_cnx(self.dbdriver, cnx)
         #self.dbapi_module.type_code_test(cnx.cursor())
         return cnx