91 self.repo = repo |
91 self.repo = repo |
92 elif connect: |
92 elif connect: |
93 self.repo_connect() |
93 self.repo_connect() |
94 # no config on shell to a remote instance |
94 # no config on shell to a remote instance |
95 if config is not None and (cnx or connect): |
95 if config is not None and (cnx or connect): |
|
96 repo = self.repo |
96 self.session.data['rebuild-infered'] = False |
97 self.session.data['rebuild-infered'] = False |
97 # register a hook to clear our group_mapping cache and the |
98 # register a hook to clear our group_mapping cache and the |
98 # self._synchronized set when some group is added or updated |
99 # self._synchronized set when some group is added or updated |
99 ClearGroupMap.mih = self |
100 ClearGroupMap.mih = self |
100 self.repo.vreg.register(ClearGroupMap) |
101 # may be already registered in tests (e.g. unittest_migractions) |
101 CW_EVENT_MANAGER.bind('after-registry-reload', |
102 if not ClearGroupMap.__regid__ in repo.vreg['after_add_entity_hooks']: |
102 self.repo.vreg.register, ClearGroupMap) |
103 repo.vreg.register(ClearGroupMap) |
|
104 CW_EVENT_MANAGER.bind('after-registry-reload', |
|
105 repo.vreg.register, ClearGroupMap) |
103 # notify we're starting maintenance (called instead of server_start |
106 # notify we're starting maintenance (called instead of server_start |
104 # which is called on regular start |
107 # which is called on regular start |
105 self.repo.hm.call_hooks('server_maintenance', repo=self.repo) |
108 repo.hm.call_hooks('server_maintenance', repo=repo) |
106 if not schema and not getattr(config, 'quick_start', False): |
109 if not schema and not getattr(config, 'quick_start', False): |
107 schema = config.load_schema(expand_cubes=True) |
110 schema = config.load_schema(expand_cubes=True) |
108 self.fs_schema = schema |
111 self.fs_schema = schema |
109 self._synchronized = set() |
112 self._synchronized = set() |
110 |
113 |