mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
6 files changed
+32
-13
No files matched your search
@@ -270,6 +270,15 @@ class Controller:
|
||||
self.notification.emit("compute.updated", self._computes[compute_id].__json__())
|
||||
return self._computes[compute_id]
|
||||
|
||||
@asyncio.coroutine
|
||||
def close_compute_projects(self, compute):
|
||||
"""
|
||||
Close projects running on a compute
|
||||
"""
|
||||
for project in self._projects.values():
|
||||
if compute in project.computes:
|
||||
yield from project.close()
|
||||
|
||||
@asyncio.coroutine
|
||||
def delete_compute(self, compute_id):
|
||||
"""
|
||||
@@ -281,11 +290,7 @@ class Controller:
|
||||
compute = self.get_compute(compute_id)
|
||||
except aiohttp.web.HTTPNotFound:
|
||||
return
|
||||
|
||||
for project in self._projects.values():
|
||||
if compute in project.computes:
|
||||
yield from project.close()
|
||||
|
||||
yield from self.close_compute_projects(compute)
|
||||
yield from compute.close()
|
||||
del self._computes[compute_id]
|
||||
self.save()
|
||||
|
||||
Reference in new issue
Block a user