From 0f85fbd5f2c9b8f8fdebbe012a29d1496e01524e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 21 Jul 2016 15:10:11 +0200 Subject: [PATCH] Avoid leaving unfinished task behind us --- gns3server/controller/compute.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index bc528035..233fc2fa 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -303,12 +303,14 @@ class Compute: response = yield from self._run_http_query("GET", "/version") if "version" not in response.json: + self._http_session.close() raise aiohttp.web.HTTPConflict(text="The server {} is not a GNS3 server".format(self._id)) self._version = response.json["version"] if parse_version(__version__)[:2] != parse_version(response.json["version"])[:2]: + self._http_session.close() raise aiohttp.web.HTTPConflict(text="The server {} versions are not compatible {} != {}".format(self._id, __version__, response.json["version"])) - self._notifications = asyncio.async(self._connect_notification()) + self._notifications = asyncio.gather(self._connect_notification()) self._connected = True self._controller.notification.emit("compute.updated", self.__json__())