Use Transaction to set correct Flavor

review1076002
This commit is contained in:
Cédric Krier committed 2013-09-20 00:33:51 +02:00
1 parent 71a2dba480
commit e813db1ea2
1 file changed
+3 -6
+3 -6
View File
@@ -197,12 +197,9 @@ class TrytondConfig(Config):
Pool.start()
database = backend.get('Database')().connect()
cursor = database.cursor()
try:
databases = database.list(cursor)
finally:
cursor.close()
with Transaction().start(None, 0) as transaction:
cursor = transaction.cursor
databases = backend.get('Database').list(cursor)
if database_name not in databases:
create(database_name, CONFIG['admin_passwd'], language, password)