fix #726167: i18ninstance use data in bootstrab_cubes instead of the database one stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Mar 2010 14:13:34 +0100
branchstable
changeset 5042 cc062bb09abb
parent 5041 ebdab53b0c45
child 5043 fe52dd3936cf
fix #726167: i18ninstance use data in bootstrab_cubes instead of the database one
cwctl.py
--- a/cwctl.py	Fri Mar 26 13:45:48 2010 +0100
+++ b/cwctl.py	Fri Mar 26 14:13:34 2010 +0100
@@ -932,20 +932,12 @@
     def i18ninstance_instance(appid):
         """recompile instance's messages catalogs"""
         config = cwcfg.config_for(appid)
-        try:
-            config.bootstrap_cubes()
-        except IOError, ex:
-            import errno
-            if ex.errno != errno.ENOENT:
-                raise
-            # bootstrap_cubes files doesn't exist
-            # notify this is not a regular start
-            config.repairing = True
-            # create an in-memory repository, will call config.init_cubes()
-            config.repository()
-        except AttributeError:
+        config.repairing = True # notify this is not a regular start
+        config.read_instance_schema = False # bootstrap schema is enough
+        repo = config.repository()
+        if config._cubes is None:
             # web only config
-            config.init_cubes(config.repository().get_cubes())
+            config.init_cubes(repo.get_cubes())
         errors = config.i18ncompile()
         if errors:
             print '\n'.join(errors)