Better handle compute unavailable errors

Fix #775
This commit is contained in:
Julien Duponchelle committed 2016-11-11 10:38:59 +01:00
1 parent f968f6616f
commit 477091207d
4 files changed
+12 -8

No files matched your search

+3 -2
View File
@@ -27,6 +27,7 @@ import tempfile
from uuid import UUID, uuid4
from .node import Node
from .compute import ComputeError
from .snapshot import Snapshot
from .drawing import Drawing
from .topology import project_to_topology, load_topology
@@ -541,7 +542,7 @@ class Project:
try:
yield from compute.post("/projects/{}/close".format(self._id))
# We don't care if a compute is down at this step
except (aiohttp.errors.ClientOSError, aiohttp.web.HTTPError, aiohttp.ClientResponseError, TimeoutError):
except (ComputeError, aiohttp.web.HTTPError, aiohttp.ClientResponseError, TimeoutError):
pass
self._cleanPictures()
self._status = "closed"
@@ -646,7 +647,7 @@ class Project:
try:
yield from compute.post("/projects/{}/close".format(self._id))
# We don't care if a compute is down at this step
except (aiohttp.errors.ClientOSError, aiohttp.web.HTTPNotFound, aiohttp.web.HTTPConflict):
except (ComputeError, aiohttp.web.HTTPNotFound, aiohttp.web.HTTPConflict):
pass
shutil.copy(path + ".backup", path)
self._status = "closed"