mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-30 20:28:08 +00:00
parent
f0fad5289c
commit
fa76b89731
@ -299,6 +299,7 @@ class Compute:
|
|||||||
# https://www.python.org/dev/peps/pep-0492/
|
# https://www.python.org/dev/peps/pep-0492/
|
||||||
# that why we wrap the answer
|
# that why we wrap the answer
|
||||||
class StreamResponse:
|
class StreamResponse:
|
||||||
|
|
||||||
def __init__(self, response):
|
def __init__(self, response):
|
||||||
self._response = response
|
self._response = response
|
||||||
|
|
||||||
@ -350,7 +351,11 @@ class Compute:
|
|||||||
"""
|
"""
|
||||||
self._ws = yield from self._session().ws_connect(self._getUrl("/notifications/ws"))
|
self._ws = yield from self._session().ws_connect(self._getUrl("/notifications/ws"))
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
response = yield from self._ws.receive()
|
response = yield from self._ws.receive()
|
||||||
|
except aiohttp.errors.WSServerHandshakeError:
|
||||||
|
self._ws = None
|
||||||
|
return
|
||||||
if response.tp == aiohttp.MsgType.closed or response.tp == aiohttp.MsgType.error:
|
if response.tp == aiohttp.MsgType.closed or response.tp == aiohttp.MsgType.error:
|
||||||
self._connected = False
|
self._connected = False
|
||||||
break
|
break
|
||||||
|
@ -165,7 +165,7 @@ class Link:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def nodes(self):
|
def nodes(self):
|
||||||
return [ node['node'] for node in self._nodes ]
|
return [node['node'] for node in self._nodes]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def capturing(self):
|
def capturing(self):
|
||||||
|
@ -127,4 +127,3 @@ def wait_for_named_pipe_creation(pipe_path, timeout=60):
|
|||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
raise asyncio.TimeoutError()
|
raise asyncio.TimeoutError()
|
||||||
|
|
||||||
|
@ -67,5 +67,3 @@ def test_wait_for_process_termination(loop):
|
|||||||
exec = wait_for_process_termination(process, timeout=0.5)
|
exec = wait_for_process_termination(process, timeout=0.5)
|
||||||
with pytest.raises(asyncio.TimeoutError):
|
with pytest.raises(asyncio.TimeoutError):
|
||||||
loop.run_until_complete(asyncio.async(exec))
|
loop.run_until_complete(asyncio.async(exec))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user