[FIX] db restoration existence check

5ee9ec7d removed bool(Connection), turns out db restore still used it
but muted the logger so that was hard to notice in the logs.
This commit is contained in:
Xavier Morel
2017-06-28 10:05:33 +02:00
parent 16ebec2324
commit 6ad587dc8f
+6 -1
View File
@@ -316,7 +316,12 @@ def exp_migrate_databases(databases):
@odoo.tools.mute_logger('odoo.sql_db')
def exp_db_exist(db_name):
## Not True: in fact, check if connection to database is possible. The database may exists
return bool(odoo.sql_db.db_connect(db_name))
try:
db = odoo.sql_db.db_connect(db_name)
with db.cursor():
return True
except Exception:
return False
def list_dbs(force=False):
if not odoo.tools.config['list_db'] and not force: