base/app_manager: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
df8f807e13
commit
f79634b3c7
@ -47,7 +47,7 @@ def _lookup_service_brick_by_mod_name(mod_name):
|
|||||||
|
|
||||||
def register_app(app):
|
def register_app(app):
|
||||||
assert isinstance(app, RyuApp)
|
assert isinstance(app, RyuApp)
|
||||||
assert not app.name in SERVICE_BRICKS
|
assert app.name not in SERVICE_BRICKS
|
||||||
SERVICE_BRICKS[app.name] = app
|
SERVICE_BRICKS[app.name] = app
|
||||||
register_instance(app)
|
register_instance(app)
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ class RyuApp(object):
|
|||||||
return handlers
|
return handlers
|
||||||
|
|
||||||
def test(h):
|
def test(h):
|
||||||
if not ev_cls in h.callers:
|
if ev_cls not in h.callers:
|
||||||
# this handler does not listen the event.
|
# this handler does not listen the event.
|
||||||
return False
|
return False
|
||||||
states = h.callers[ev_cls].dispatchers
|
states = h.callers[ev_cls].dispatchers
|
||||||
@ -356,7 +356,7 @@ class AppManager(object):
|
|||||||
context_modules = map(lambda x: x.__module__,
|
context_modules = map(lambda x: x.__module__,
|
||||||
self.contexts_cls.values())
|
self.contexts_cls.values())
|
||||||
for i in get_dependent_services(cls):
|
for i in get_dependent_services(cls):
|
||||||
if not i in context_modules:
|
if i not in context_modules:
|
||||||
services.append(i)
|
services.append(i)
|
||||||
if services:
|
if services:
|
||||||
app_lists.extend(services)
|
app_lists.extend(services)
|
||||||
@ -369,7 +369,7 @@ class AppManager(object):
|
|||||||
else:
|
else:
|
||||||
context = cls()
|
context = cls()
|
||||||
LOG.info('creating context %s', key)
|
LOG.info('creating context %s', key)
|
||||||
assert not key in self.contexts
|
assert key not in self.contexts
|
||||||
self.contexts[key] = context
|
self.contexts[key] = context
|
||||||
return self.contexts
|
return self.contexts
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ class AppManager(object):
|
|||||||
# Yes, maybe for slicing.
|
# Yes, maybe for slicing.
|
||||||
LOG.info('instantiating app %s of %s', app_name, cls.__name__)
|
LOG.info('instantiating app %s of %s', app_name, cls.__name__)
|
||||||
|
|
||||||
if hasattr(cls, 'OFP_VERSIONS') and not cls.OFP_VERSIONS is None:
|
if hasattr(cls, 'OFP_VERSIONS') and cls.OFP_VERSIONS is not None:
|
||||||
ofproto_protocol.set_app_supported_versions(cls.OFP_VERSIONS)
|
ofproto_protocol.set_app_supported_versions(cls.OFP_VERSIONS)
|
||||||
|
|
||||||
if app_name is not None:
|
if app_name is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user