app_manager: add some assertions and LOG.info

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2013-02-08 12:28:14 +09:00 committed by FUJITA Tomonori
parent d7163b5463
commit 4b8a4fc870

View File

@ -35,6 +35,8 @@ def lookup_service_brick(name):
def register_app(app):
assert isinstance(app, RyuApp)
assert not app.name in SERVICE_BRICKS
SERVICE_BRICKS[app.name] = app
register_instance(app)
@ -146,6 +148,8 @@ class AppManager(object):
def create_contexts(self):
for key, cls in self.contexts_cls.items():
context = cls()
LOG.info('creating context %s', key)
assert not key in self.contexts
self.contexts[key] = context
# hack for dpset
if context.__class__.__base__ == RyuApp: