Skip to content

Commit

Permalink
[FIX] db restoration existence check
Browse files Browse the repository at this point in the history
5ee9ec7 removed bool(Connection), turns out db restore still used it
but muted the logger so that was hard to notice in the logs.
  • Loading branch information
xmo-odoo committed Jun 28, 2017
1 parent 16ebec2 commit 6ad587d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion odoo/service/db.py
Expand Up @@ -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:
Expand Down

0 comments on commit 6ad587d

Please sign in to comment.