summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason Kölker <jason@koelker.net>2015-08-14 19:29:16 +0000
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-08-18 00:11:04 +0900
commit6921b54ac56a3048ff03ae1e247d6303d76d9051 (patch)
treea04b15afda34fd5bd086d97f8d8ad950266ab8e0
parent5c4a199c7c7f457131c38b85b1e42abd315b2d2a (diff)
Stop old app on reconnection
Signed-off-by: Jason Kölker <jason@koelker.net> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/ovsdb/client.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/ryu/services/protocols/ovsdb/client.py b/ryu/services/protocols/ovsdb/client.py
index 64a8bfcb..69d334fe 100644
--- a/ryu/services/protocols/ovsdb/client.py
+++ b/ryu/services/protocols/ovsdb/client.py
@@ -227,7 +227,19 @@ class RemoteOvsdb(app_manager.RyuApp):
kwargs['system_id'] = system_id
app_mgr = app_manager.AppManager.get_instance()
- return app_mgr.instantiate(cls, *args, **kwargs)
+
+ old_app = app_manager.lookup_service_brick(name)
+ old_events = None
+ if old_app:
+ old_events = old_app.events
+ app_mgr.uninstantiate(name)
+
+ app = app_mgr.instantiate(cls, *args, **kwargs)
+
+ if old_events:
+ app.events = old_events
+
+ return app
@classmethod
def instance_name(cls, system_id):