# HG changeset patch # User Denis Laxalde # Date 1487867927 -3600 # Node ID c93b47ba009393690abfd276287d9b4a1372d315 # Parent 9d27e426adc2809cf7a94eb715e94894c9b37b1a [server] Drop close/open steps in NativeSQLSource.restore() The only place where this is called is in ServerMigrationHelper.restore_database() where config.init_cnxset_pool is set to False. So these steps appear to be useless. diff -r 9d27e426adc2 -r c93b47ba0093 cubicweb/server/sources/native.py --- a/cubicweb/server/sources/native.py Tue Feb 07 10:37:37 2017 +0100 +++ b/cubicweb/server/sources/native.py Thu Feb 23 17:38:47 2017 +0100 @@ -417,19 +417,13 @@ def restore(self, backupfile, confirm, drop, format='native'): """method called to restore a backup of source's data""" - if self.repo.config.init_cnxset_pool: - self.close_source_connections() - try: - if format == 'portable': - helper = DatabaseIndependentBackupRestore(self) - helper.restore(backupfile) - elif format == 'native': - self.restore_from_file(backupfile, confirm, drop=drop) - else: - raise ValueError('Unknown format %r' % format) - finally: - if self.repo.config.init_cnxset_pool: - self.open_source_connections() + if format == 'portable': + helper = DatabaseIndependentBackupRestore(self) + helper.restore(backupfile) + elif format == 'native': + self.restore_from_file(backupfile, confirm, drop=drop) + else: + raise ValueError('Unknown format %r' % format) def init(self, activated, source_entity): super(NativeSQLSource, self).init(activated, source_entity)