[vreg repo] shouldn't call init_registration in on hook registry bootstrap, already done before
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 30 Apr 2010 14:34:56 +0200
changeset 5447 f29dafba250a
parent 5446 b018324198d4
child 5452 4ac3ea9face9
[vreg repo] shouldn't call init_registration in on hook registry bootstrap, already done before
server/repository.py
--- a/server/repository.py	Fri Apr 30 12:46:51 2010 +0200
+++ b/server/repository.py	Fri Apr 30 14:34:56 2010 +0200
@@ -152,13 +152,6 @@
                 if not isinstance(session.user, InternalManager):
                     session.user.__class__ = usercls
 
-    def _bootstrap_hook_registry(self):
-        """called during bootstrap since we need the metadata hooks"""
-        hooksdirectory = join(CW_SOFTWARE_ROOT, 'hooks')
-        self.vreg.init_registration([hooksdirectory])
-        self.vreg.load_file(join(hooksdirectory, 'metadata.py'),
-                            'cubicweb.hooks.metadata')
-
     def open_connections_pools(self):
         config = self.config
         self._available_pools = Queue.Queue()
@@ -184,7 +177,9 @@
             for modname in ('__init__', 'authobjs', 'wfobjs'):
                 self.vreg.load_file(join(etdirectory, '%s.py' % modname),
                                     'cubicweb.entities.%s' % modname)
-            self._bootstrap_hook_registry()
+            hooksdirectory = join(CW_SOFTWARE_ROOT, 'hooks')
+            self.vreg.load_file(join(hooksdirectory, 'metadata.py'),
+                                'cubicweb.hooks.metadata')
         elif config.read_instance_schema:
             # normal start: load the instance schema from the database
             self.fill_schema()
@@ -233,8 +228,7 @@
         if resetvreg:
             if self.config._cubes is None:
                 self.config.init_cubes(self.get_cubes())
-            # full reload of all appobjects
-            self.vreg.reset()
+            # trigger full reload of all appobjects
             self.vreg.set_schema(schema)
         else:
             self.vreg._set_schema(schema)