allow RyuApp start() method returns Greenlet thread
This enables an application to continue. Without this, ryu-manager finishes right after running applications. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
e39fec0238
commit
8ace63f0c9
@ -303,8 +303,12 @@ class AppManager(object):
|
||||
self._update_bricks()
|
||||
self.report_bricks()
|
||||
|
||||
threads = []
|
||||
for app in self.applications.values():
|
||||
app.start()
|
||||
t = app.start()
|
||||
if t is not None:
|
||||
threads.append(t)
|
||||
return threads
|
||||
|
||||
@staticmethod
|
||||
def _close(app):
|
||||
|
@ -69,9 +69,8 @@ def main():
|
||||
app_mgr = AppManager.get_instance()
|
||||
app_mgr.load_apps(app_lists)
|
||||
contexts = app_mgr.create_contexts()
|
||||
app_mgr.instantiate_apps(**contexts)
|
||||
|
||||
services = []
|
||||
services.extend(app_mgr.instantiate_apps(**contexts))
|
||||
|
||||
# TODO: do the following in app_manager's instantiate_apps()
|
||||
ofpapp = controller.start_service(app_mgr)
|
||||
|
@ -61,8 +61,9 @@ class VRRPManager(app_manager.RyuApp):
|
||||
self.shutdown = hub.Queue()
|
||||
|
||||
def start(self):
|
||||
self.threads.append(hub.spawn(self._shutdown_loop))
|
||||
t = hub.spawn(self._shutdown_loop)
|
||||
super(VRRPManager, self).start()
|
||||
return t
|
||||
|
||||
@handler.set_ev_cls(vrrp_event.EventVRRPConfigRequest)
|
||||
def config_request_handler(self, ev):
|
||||
|
Loading…
x
Reference in New Issue
Block a user