1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-03 08:24:27 +00:00

Ignore non-fatal errors in database upgrade.

This commit is contained in:
cuihaikuo
2018-07-04 12:09:00 +08:00
parent f8a3a2e570
commit fe76dd1468

View File

@@ -43,6 +43,10 @@ class Utils(object):
def info(msg):
print Utils.highlight('[INFO] ') + msg
@staticmethod
def warning(msg):
print Utils.highlight('[WARNING] ') + msg
@staticmethod
def error(msg):
print Utils.highlight('[ERROR] ') + msg
@@ -350,10 +354,10 @@ class MySQLDBUpdater(DBUpdater):
except Exception, e:
if isinstance(e, MySQLdb.OperationalError):
msg = str(e.args[1])
Utils.error('Failed to execute sql: %s' % msg)
else:
msg = str(e)
Utils.error('Failed to execute sql: %s' % msg)
Utils.warning('Failed to execute sql: %s' % msg)
def apply_sqls(self, info, sql_path):
with open(sql_path, 'r') as fp: