This enables an application to continue. Without this, ryu-manager finishes right after running applications.
Signed-off-by: FUJITA Tomonori <[email protected]> --- ryu/base/app_manager.py | 6 +++++- ryu/cmd/manager.py | 3 +-- ryu/services/protocols/vrrp/manager.py | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py index 99dde02..ebf2196 100644 --- a/ryu/base/app_manager.py +++ b/ryu/base/app_manager.py @@ -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): diff --git a/ryu/cmd/manager.py b/ryu/cmd/manager.py index a2912e5..474dcec 100755 --- a/ryu/cmd/manager.py +++ b/ryu/cmd/manager.py @@ -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) diff --git a/ryu/services/protocols/vrrp/manager.py b/ryu/services/protocols/vrrp/manager.py index 2a25ebc..489b9ce 100644 --- a/ryu/services/protocols/vrrp/manager.py +++ b/ryu/services/protocols/vrrp/manager.py @@ -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): -- 1.8.3.4 (Apple Git-47) ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
