# HG changeset patch # User Sylvain Thénault # Date 1464269919 -7200 # Node ID 3b4d41566de30ef0e570f83718814dfb478e3586 # Parent a9f26de5ea6ceddfe9534e17bd42d6cfb0d79a8d [repo] Don't crash on start when fs schema is missing some db schema entities This occurs usually while developping and we don't want systematically to rebuild the database to start the instance or run e.g. i18ninstance. diff -r a9f26de5ea6c -r 3b4d41566de3 cubicweb/server/repository.py --- a/cubicweb/server/repository.py Fri Sep 23 13:36:06 2016 +0200 +++ b/cubicweb/server/repository.py Thu May 26 15:38:39 2016 +0200 @@ -234,7 +234,12 @@ # set eids on entities schema with self.internal_cnx() as cnx: for etype, eid in cnx.execute('Any XN,X WHERE X is CWEType, X name XN'): - self.schema.eschema(etype).eid = eid + try: + self.schema.eschema(etype).eid = eid + except KeyError: + # etype in the database doesn't exist in the fs schema, this may occur + # during dev and we shouldn't crash + self.warning('No %s entity type in the file system schema', etype) else: # normal start: load the instance schema from the database self.info('loading schema from the repository')