merge stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 22 Dec 2009 11:07:07 +0100
branchstable
changeset 4178 0441165c7e59
parent 4177 f0ab2b6d3553 (diff)
parent 4175 92a10d2a09af (current diff)
child 4179 3a0b2f14e17b
merge
--- a/debian/control	Tue Dec 22 10:42:51 2009 +0100
+++ b/debian/control	Tue Dec 22 11:07:07 2009 +0100
@@ -77,7 +77,7 @@
 Package: cubicweb-common
 Architecture: all
 XB-Python-Version: ${python:Versions}
-Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.45.2), python-yams (>= 0.25.0), python-rql (>= 0.22.3), python-lxml
+Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.46.0), python-yams (>= 0.25.0), python-rql (>= 0.22.3), python-lxml
 Recommends: python-simpletal (>= 4.0)
 Conflicts: cubicweb-core
 Replaces: cubicweb-core
--- a/server/serverctl.py	Tue Dec 22 10:42:51 2009 +0100
+++ b/server/serverctl.py	Tue Dec 22 11:07:07 2009 +0100
@@ -57,7 +57,8 @@
         else:
             password = getpass('password: ')
     return get_connection(driver, dbhost, dbname, user, password=password,
-                          port=source.get('db-port'))
+                          port=source.get('db-port'),
+                          extra_args=source.get('db-extra-arguments'))
 
 def system_source_cnx(source, dbms_system_base=False,
                       special_privs='CREATE/DROP DATABASE', verbose=True):
@@ -368,7 +369,8 @@
             get_connection(
                 system['db-driver'], database=system['db-name'],
                 host=system.get('db-host'), port=system.get('db-port'),
-                user=system.get('db-user'), password=system.get('db-password'))
+                user=system.get('db-user'), password=system.get('db-password'), 
+                extra_args=system.get('db-extra-arguments'))
         except Exception, ex:
             raise ConfigurationError(
                 'You seem to have provided wrong connection information in '\
--- a/server/sqlutils.py	Tue Dec 22 10:42:51 2009 +0100
+++ b/server/sqlutils.py	Tue Dec 22 11:07:07 2009 +0100
@@ -144,6 +144,7 @@
         self.dbpasswd = source_config.get('db-password')
         self.encoding = source_config.get('db-encoding', 'UTF-8')
         self.dbapi_module = db.get_dbapi_compliant_module(self.dbdriver)
+        self.dbdriver_extra_args = source_config.get('db-extra-arguments')
         self.binary = self.dbapi_module.Binary
         self.dbhelper = self.dbapi_module.adv_func_helper
         self.sqlgen = SQLGenerator()
@@ -159,7 +160,8 @@
         cnx = self.dbapi_module.connect(self.dbhost, self.dbname,
                                         user or self.dbuser,
                                         password or self.dbpasswd,
-                                        port=self.dbport)
+                                        port=self.dbport,
+                                        extra_args=self.dbdriver_extra_args)
         init_cnx(self.dbdriver, cnx)
         #self.dbapi_module.type_code_test(cnx.cursor())
         return cnx
@@ -241,6 +243,7 @@
                         value = value.getvalue()
                     else:
                         value = crypt_password(value)
+                    value = self.binary(value)
                 # XXX needed for sqlite but I don't think it is for other backends
                 elif atype == 'Datetime' and isinstance(value, date):
                     value = todatetime(value)