[sources] Skip problematic sources when starting shell instead of crashing. Closes #3670208
At least this gives an opportunity to fix the problem in using c-c shell, which
is currently not possible because it crashes during initialization.
Notice that since sources are copy based, it should not be a problem at all to
have some disabled, beside for services such as authentication sources as
ldapfeed.
--- a/server/repository.py Fri Apr 04 17:32:12 2014 +0200
+++ b/server/repository.py Thu Mar 20 08:45:52 2014 +0100
@@ -282,8 +282,14 @@
clear_cache(self, 'source_defs')
def add_source(self, sourceent):
- source = self.get_source(sourceent.type, sourceent.name,
- sourceent.host_config, sourceent.eid)
+ try:
+ source = self.get_source(sourceent.type, sourceent.name,
+ sourceent.host_config, sourceent.eid)
+ except RuntimeError:
+ if self.config.repairing:
+ self.exception('cant setup source %s, skipped', sourceent.name)
+ return
+ raise
self.sources_by_eid[sourceent.eid] = source
self.sources_by_uri[sourceent.name] = source
if self.config.source_enabled(source):