Currently, EventNewOVSDBConnection only has system_id. This patch let the class has RemoteOvsdb to get more informations through it.
e.g.) @set_ev_cls(ovsdb_event.EventNewOVSDBConnection) def handle_new_ovsdb_connection(self, ev): system_id = ev.system_id remote_addr = ev.client.address Signed-off-by: Satoshi Fujimoto <satoshi.fujimo...@gmail.com> --- ryu/services/protocols/ovsdb/event.py | 10 +++++++--- ryu/services/protocols/ovsdb/manager.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ryu/services/protocols/ovsdb/event.py b/ryu/services/protocols/ovsdb/event.py index 486e5c7..f162b52 100644 --- a/ryu/services/protocols/ovsdb/event.py +++ b/ryu/services/protocols/ovsdb/event.py @@ -119,13 +119,17 @@ class EventModifyReply(ryu_event.EventReplyBase): class EventNewOVSDBConnection(ryu_event.EventBase): - def __init__(self, system_id): + def __init__(self, client): super(EventNewOVSDBConnection, self).__init__() - self.system_id = system_id + self.client = client def __str__(self): return '%s<system_id=%s>' % (self.__class__.__name__, - self.system_id) + self.client.system_id) + + @property + def system_id(self): + return self.client.system_id class EventReadRequest(ryu_event.EventRequestBase): diff --git a/ryu/services/protocols/ovsdb/manager.py b/ryu/services/protocols/ovsdb/manager.py index 86a2d1f..9822503 100644 --- a/ryu/services/protocols/ovsdb/manager.py +++ b/ryu/services/protocols/ovsdb/manager.py @@ -146,7 +146,7 @@ class OVSDB(app_manager.RyuApp): if app: self._clients[app.name] = app app.start() - ev = event.EventNewOVSDBConnection(app.system_id) + ev = event.EventNewOVSDBConnection(app) self.send_event_to_observers(ev) else: -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel