From ff61f79a883f1602b94ce3ca828fcd05b992e2f9 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 31 Aug 2016 09:59:50 +0200 Subject: [PATCH] Catch 401 error when connecting to a compute websocket --- gns3server/controller/compute.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 701eab96..00ad52bd 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -371,8 +371,11 @@ class Compute: """ Connect to the notification stream """ - self._ws = yield from self._session().ws_connect(self._getUrl("/notifications/ws")) - while True: + try: + self._ws = yield from self._session().ws_connect(self._getUrl("/notifications/ws")) + except aiohttp.errors.WSServerHandshakeError: + self._ws + while self._ws is not None: try: response = yield from self._ws.receive() except aiohttp.errors.WSServerHandshakeError: