summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSatoshi Fujimoto <satoshi.fujimoto7@gmail.com>2017-06-30 10:58:50 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-07-02 20:21:14 +0900
commit60651d8a1c092453c4de8980381bdc02dbc01aaa (patch)
tree23831515287cf2bd2b66fe9e5d18240c4877aa74
parentcd67c52471299bec89b09f0f32f495393ff97cd1 (diff)
service/ovsdb: get socket from RemoteOvsdb
This patch adds "socket" field to RemoteOvsdb to get sockets which connects to switches. e.g.) @set_ev_cls(ovsdb_event.EventNewOVSDBConnection) def handle_new_ovsdb_connection(self, ev): print(ev.client.socket.getsockname()[0]) Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/ovsdb/client.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ryu/services/protocols/ovsdb/client.py b/ryu/services/protocols/ovsdb/client.py
index 7e7d2718..7c939f09 100644
--- a/ryu/services/protocols/ovsdb/client.py
+++ b/ryu/services/protocols/ovsdb/client.py
@@ -333,6 +333,7 @@ class RemoteOvsdb(app_manager.RyuApp):
fsm.set_name(name)
kwargs = kwargs.copy()
+ kwargs['socket'] = sock
kwargs['address'] = address
kwargs['idl'] = idl
kwargs['name'] = name
@@ -359,6 +360,7 @@ class RemoteOvsdb(app_manager.RyuApp):
def __init__(self, *args, **kwargs):
super(RemoteOvsdb, self).__init__(*args, **kwargs)
+ self.socket = kwargs['socket']
self.address = kwargs['address']
self._idl = kwargs['idl']
self.system_id = kwargs['system_id']