fix necessary when adding a cube which isn't listed in fs dependencies of the instance stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 13 Nov 2009 09:15:28 +0100
branchstable
changeset 3836 58c09f21f503
parent 3835 a191b3b9e455
child 3837 0cb409871d42
fix necessary when adding a cube which isn't listed in fs dependencies of the instance
server/migractions.py
--- a/server/migractions.py	Fri Nov 13 09:13:30 2009 +0100
+++ b/server/migractions.py	Fri Nov 13 09:15:28 2009 +0100
@@ -526,10 +526,17 @@
                 sourcescfg[cube] = ask_source_config(cube)
                 self.config.write_sources_file(sourcescfg)
                 clear_cache(self.config, 'read_sources_file')
+            # ensure added cube is in config cubes
+            # XXX worth restoring on error?
+            if not cube in self.config._cubes:
+                self.config._cubes += (cube,)
         if not update_database:
             self.commit()
             return
         newcubes_schema = self.config.load_schema(construction_mode='non-strict')
+        # XXX we have to replace fs_schema, used in cmd_add_relation_type
+        # etc. and fsschema of migration script contexts
+        self.fs_schema = self._create_context()['fsschema'] = newcubes_schema
         new = set()
         # execute pre-create files
         for pack in reversed(newcubes):