[testlib, postgres] take care, _repo is None when backuping postgres test db, crashing database generation stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 21 Dec 2011 18:14:01 +0100
branchstable
changeset 8175 89fcaca0bca0
parent 8174 b3e87e6865ef
child 8177 e4ab883f07d9
[testlib, postgres] take care, _repo is None when backuping postgres test db, crashing database generation
devtools/__init__.py
--- a/devtools/__init__.py	Wed Jan 18 17:27:11 2012 +0100
+++ b/devtools/__init__.py	Wed Dec 21 18:14:01 2011 +0100
@@ -620,10 +620,12 @@
             backup_name = self._backup_name(db_id)
             self._drop(backup_name)
             self.system_source['db-name'] = backup_name
-            self._repo.turn_repo_off()
+            # during postgres database initialization, there is no repo set here.
+            assert self._repo is None
+            #self._repo.turn_repo_off()
             createdb(self.helper, self.system_source, self.dbcnx, self.cursor, template=orig_name)
             self.dbcnx.commit()
-            self._repo.turn_repo_on()
+            #self._repo.turn_repo_on()
             return backup_name
         finally:
             self.system_source['db-name'] = orig_name