1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-29 18:28:11 +00:00

Avoid leaving unfinished task behind us

This commit is contained in:
Julien Duponchelle 2016-07-21 15:10:11 +02:00
parent b5ab53bbe9
commit 0f85fbd5f2
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -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__())