[massive store] Turn a runtime error into an assertion
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Oct 2016 10:23:06 +0200
changeset 11786 f5d26d3648d4
parent 11785 0cea67f41d0c
child 11787 05b3e44c135f
[massive store] Turn a runtime error into an assertion geting there is a bug.
cubicweb/dataimport/massive_store.py
--- a/cubicweb/dataimport/massive_store.py	Wed Oct 05 09:27:25 2016 +0200
+++ b/cubicweb/dataimport/massive_store.py	Tue Oct 11 10:23:06 2016 +0200
@@ -229,8 +229,7 @@
 
     def finish(self):
         """Remove temporary tables and columns."""
-        if self.slave_mode:
-            raise RuntimeError('Store cleanup is not allowed in slave mode')
+        assert not self.slave_mode, 'finish method should only be called by the master store'
         self.logger.info("Start cleaning")
         # Get all the initialized etypes/rtypes
         if self._dbh.table_exists('cwmassive_initialized'):