Close project if one one the compute of the project is down

Fix #836
This commit is contained in:
Julien Duponchelle committed 2016-12-15 21:57:59 +01:00
1 parent 60eea1f171
commit 3259ec1220
6 files changed
+32 -13

No files matched your search

+10 -5
View File
@@ -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()