# HG changeset patch # User Sylvain Thénault # Date 1349448862 -7200 # Node ID d753d6a6798f4e486a9112b8f6a25d50eca8b611 # Parent c4673bc11053b5442e6dfcb526a8e62f2b924d8e [repository] move modification of appobject_path to repository initialization code so we can restore it later to avoid side effect on the config. Fix regression introduced in d32ab8570e5d diff -r c4673bc11053 -r d753d6a6798f server/__init__.py --- a/server/__init__.py Thu Oct 11 18:42:13 2012 +0200 +++ b/server/__init__.py Fri Oct 05 16:54:22 2012 +0200 @@ -165,6 +165,8 @@ # on connection config.creating = True config.consider_user_state = False + config.cubicweb_appobject_path = set(('hooks', 'entities')) + config.cube_appobject_path = set(('hooks', 'entities')) # only enable the system source at initialization time repo = Repository(config, vreg=vreg) schema = repo.schema @@ -242,6 +244,9 @@ # restore initial configuration config.creating = False config.consider_user_state = True + # (drop instance attribute to get back to class attribute) + del config.cubicweb_appobject_path + del config.cube_appobject_path print '-> database for instance %s initialized.' % config.appid diff -r c4673bc11053 -r d753d6a6798f server/repository.py --- a/server/repository.py Thu Oct 11 18:42:13 2012 +0200 +++ b/server/repository.py Fri Oct 05 16:54:22 2012 +0200 @@ -223,19 +223,13 @@ config['connections-pool-size'] = 1 # will be reinitialized later from cubes found in the database config._cubes = None - elif config.creating: - # repository creation - config.bootstrap_cubes() - # trigger vreg initialisation of entity classes - config.cubicweb_appobject_path = set(('hooks', 'entities')) - config.cube_appobject_path = set(('hooks', 'entities')) - self.set_schema(config.load_schema()) elif config.read_instance_schema: # normal start: load the instance schema from the database self.fill_schema() else: - # test start: use the file system schema (quicker) - self.warning("set fs 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()) if not config.creating: