提交 3420a7c5 编写于 作者: G gongzt

Delete database consistency changes

上级 dff80ec4
...@@ -545,15 +545,8 @@ class InitDataBase(): ...@@ -545,15 +545,8 @@ class InitDataBase():
Raises: Raises:
IOError: File or network operation io abnormal IOError: File or network operation io abnormal
""" """
if self.db_type == 'mysql':
del_result = MysqlDatabaseOperations.drop_database(db_name)
else:
if not hasattr(self, '_sqlite_db') or getattr(self, '_sqlite_db') is None:
self._sqlite_db = SqliteDatabaseOperations(db_name=db_name)
del_result = self._sqlite_db.drop_database()
if del_result:
try: try:
del_result = True
file_read = open( file_read = open(
system_config.DATABASE_FILE_INFO, 'r', encoding='utf-8') system_config.DATABASE_FILE_INFO, 'r', encoding='utf-8')
_databases = yaml.load( _databases = yaml.load(
...@@ -569,6 +562,15 @@ class InitDataBase(): ...@@ -569,6 +562,15 @@ class InitDataBase():
del_result = False del_result = False
finally: finally:
file_read.close() file_read.close()
if del_result:
if self.db_type == 'mysql':
del_result = MysqlDatabaseOperations.drop_database(db_name)
else:
if not hasattr(self, '_sqlite_db') or getattr(self, '_sqlite_db') is None:
self._sqlite_db = SqliteDatabaseOperations(db_name=db_name)
del_result = self._sqlite_db.drop_database()
return del_result return del_result
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册