[server] fix repository initialisation
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Fri, 09 Nov 2012 17:14:18 +0100
changeset 8592 df16bd045cae
parent 8581 ac3cbf55d9fb
child 8593 41259e1f9d48
[server] fix repository initialisation Changeset d753d6a6798f was breaking database creation. Dropping the `config.creating` clause lead to trying to load the schema from database even in creation mode. Conditional are a bit altered and reordered to prevent this to happen.
server/repository.py
--- a/server/repository.py	Tue Sep 11 12:42:26 2012 +0200
+++ b/server/repository.py	Fri Nov 09 17:14:18 2012 +0100
@@ -223,15 +223,15 @@
             config['connections-pool-size'] = 1
             # will be reinitialized later from cubes found in the database
             config._cubes = None
-        elif config.read_instance_schema:
-            # normal start: load the instance schema from the database
-            self.fill_schema()
-        else:
+        elif config.creating or not config.read_instance_schema:
             if not config.creating:
                 # test start: use the file system schema (quicker)
                 self.warning("set fs instance'schema")
             config.bootstrap_cubes()
             self.set_schema(config.load_schema())
+        else:
+            # normal start: load the instance schema from the database
+            self.fill_schema()
         if not config.creating:
             self.init_sources_from_database()
             if 'CWProperty' in self.schema: