mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-12 21:15:27 +03:00
Ignore HTTPException received when closing a project
This commit is contained in:
parent
0d1341b4e0
commit
cb18b60c5d
@ -15,7 +15,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
@ -30,6 +29,7 @@ import zipfile
|
|||||||
import pathlib
|
import pathlib
|
||||||
|
|
||||||
from uuid import UUID, uuid4
|
from uuid import UUID, uuid4
|
||||||
|
from fastapi import HTTPException, status
|
||||||
|
|
||||||
from .node import Node
|
from .node import Node
|
||||||
from .compute import ComputeError
|
from .compute import ComputeError
|
||||||
@ -837,7 +837,11 @@ class Project:
|
|||||||
log.warning(f"Closing project '{self.name}' ignored because it is being loaded")
|
log.warning(f"Closing project '{self.name}' ignored because it is being loaded")
|
||||||
return
|
return
|
||||||
self._closing = True
|
self._closing = True
|
||||||
await self.stop_all()
|
try:
|
||||||
|
await self.stop_all()
|
||||||
|
except HTTPException as e:
|
||||||
|
if not e.status_code == status.HTTP_405_METHOD_NOT_ALLOWED:
|
||||||
|
raise
|
||||||
for compute in list(self._project_created_on_compute):
|
for compute in list(self._project_created_on_compute):
|
||||||
try:
|
try:
|
||||||
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
await compute.post(f"/projects/{self._id}/close", dont_connect=True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user