Handle disconnection during discover_system_id
Signed-off-by: Jason Kölker <jason@koelker.net> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
d71d84fe08
commit
2119e6c787
ryu/services/protocols/ovsdb
@ -97,7 +97,7 @@ def discover_schemas(connection):
|
||||
def discover_system_id(idl):
|
||||
system_id = None
|
||||
|
||||
while system_id is None:
|
||||
while system_id is None and idl._session.is_connected():
|
||||
idl.run()
|
||||
openvswitch = idl.tables['Open_vSwitch'].rows
|
||||
|
||||
@ -211,6 +211,10 @@ class RemoteOvsdb(app_manager.RyuApp):
|
||||
idl = Idl(session, schemas[0])
|
||||
|
||||
system_id = discover_system_id(idl)
|
||||
|
||||
if not system_id:
|
||||
return None
|
||||
|
||||
name = cls.instance_name(system_id)
|
||||
ovs_stream.name = name
|
||||
connection.name = name
|
||||
|
@ -91,6 +91,10 @@ class OVSDB(app_manager.RyuApp):
|
||||
ev = event.EventNewOVSDBConnection(app.system_id)
|
||||
self.send_event_to_observers(ev)
|
||||
|
||||
else:
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
sock.close()
|
||||
|
||||
def start(self):
|
||||
server = hub.listen((self._address, self._port))
|
||||
key = self.CONF.ovsdb.mngr_privkey or self.CONF.ctl_privkey
|
||||
|
Loading…
x
Reference in New Issue
Block a user