mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-26 16:01:08 +00:00
Fix bug when GNS3 VM were not saved. Fix tests.
This commit is contained in:
parent
6dc58b28fd
commit
e962717448
@ -74,6 +74,7 @@ class Compute:
|
|||||||
self._user = None
|
self._user = None
|
||||||
self._password = None
|
self._password = None
|
||||||
self._connected = False
|
self._connected = False
|
||||||
|
self._notifications = None
|
||||||
self._closed = False # Close mean we are destroying the compute node
|
self._closed = False # Close mean we are destroying the compute node
|
||||||
self._controller = controller
|
self._controller = controller
|
||||||
self._set_auth(user, password)
|
self._set_auth(user, password)
|
||||||
@ -155,6 +156,7 @@ class Compute:
|
|||||||
if self._http_session and not self._http_session.closed:
|
if self._http_session and not self._http_session.closed:
|
||||||
await self._http_session.close()
|
await self._http_session.close()
|
||||||
try:
|
try:
|
||||||
|
if self._notifications:
|
||||||
await self._notifications
|
await self._notifications
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
pass
|
pass
|
||||||
@ -448,6 +450,8 @@ class Compute:
|
|||||||
pass
|
pass
|
||||||
self._connected = False
|
self._connected = False
|
||||||
break
|
break
|
||||||
|
except aiohttp.client_exceptions.ClientResponseError as e:
|
||||||
|
log.error("Client response error received on compute WebSocket '{}': {}".format(ws_url,e))
|
||||||
finally:
|
finally:
|
||||||
log.info("Connection closed to compute WebSocket '{}'".format(ws_url))
|
log.info("Connection closed to compute WebSocket '{}'".format(ws_url))
|
||||||
|
|
||||||
|
@ -72,7 +72,9 @@ class GNS3VMHandler:
|
|||||||
})
|
})
|
||||||
async def update(request, response):
|
async def update(request, response):
|
||||||
|
|
||||||
gns3_vm = Controller().instance().gns3vm
|
controller = Controller().instance()
|
||||||
|
gns3_vm = controller.gns3vm
|
||||||
await gns3_vm.update_settings(request.json)
|
await gns3_vm.update_settings(request.json)
|
||||||
|
controller.save()
|
||||||
response.json(gns3_vm)
|
response.json(gns3_vm)
|
||||||
response.set_status(201)
|
response.set_status(201)
|
||||||
|
Loading…
Reference in New Issue
Block a user