Defend agains exceptions in application initialisation

Application initialisation code (as found in initialize function)
can raise an exception, which would break entire pipeline set-up.

This fix catches and logs the exception. The application is not
removed - it can continue to work on a best-effort basis.

TrivialFix

Change-Id: I5c2f00578ba5208ab7fed4441e4919cd3d71ae34
This commit is contained in:
Omer Anson 2019-03-17 22:04:31 +02:00 committed by Shachar Snapiri
parent 8fd27641b0
commit 65ebe3a52f
1 changed files with 5 additions and 2 deletions

View File

@ -112,8 +112,11 @@ class Datapath(object):
self.write_datapath_allocation()
for app in self.apps.values():
app.initialize()
for name, app in self.apps.items():
try:
app.initialize()
except Exception:
LOG.exception('Failed to initialize %s (%s)', name, app)
for edge in self._layout.edges:
self._install_edge(edge)