provide logilab.database compat when creating database stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 12 Mar 2010 11:50:27 +0100
branchstable
changeset 4888 fc8b4d861f34
parent 4887 99a95606c2a1
child 4889 b3e2de8f53cd
provide logilab.database compat when creating database
server/serverctl.py
--- a/server/serverctl.py	Fri Mar 12 11:49:29 2010 +0100
+++ b/server/serverctl.py	Fri Mar 12 11:50:27 2010 +0100
@@ -330,8 +330,13 @@
                     helper.create_database(cursor, dbname, source['db-user'],
                                            source['db-encoding'])
                 else:
-                    helper.create_database(cursor, dbname,
-                                           encoding=source['db-encoding'])
+                    try:
+                        helper.create_database(cursor, dbname,
+                                               encoding=source['db-encoding'])
+                    except TypeError:
+                        # logilab.database
+                        helper.create_database(cursor, dbname,
+                                               dbencoding=source['db-encoding'])
                 dbcnx.commit()
                 print '-> database %s created.' % dbname
             except: