mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
3 files changed
+11
-4
No files matched your search
@@ -440,12 +440,13 @@ class Project:
|
||||
os.remove(snapshot.path)
|
||||
|
||||
@asyncio.coroutine
|
||||
def close(self):
|
||||
def close(self, ignore_notification=False):
|
||||
for compute in self._project_created_on_compute:
|
||||
yield from compute.post("/projects/{}/close".format(self._id))
|
||||
self._cleanPictures()
|
||||
self._status = "closed"
|
||||
self.controller.notification.emit("project.closed", self.__json__())
|
||||
if not ignore_notification:
|
||||
self.controller.notification.emit("project.closed", self.__json__())
|
||||
|
||||
def _cleanPictures(self):
|
||||
"""
|
||||
|
||||
@@ -77,7 +77,8 @@ class Snapshot:
|
||||
"""
|
||||
|
||||
yield from self._project.delete_on_computes()
|
||||
yield from self._project.close()
|
||||
# We don't send close notif to clients because the close / open dance is purely internal
|
||||
yield from self._project.close(ignore_notification=True)
|
||||
shutil.rmtree(os.path.join(self._project.path, "project-files"))
|
||||
with open(self._path, "rb") as f:
|
||||
project = yield from import_project(self._project.controller, self._project.id, f, location=self._project.path)
|
||||
|
||||
Reference in new issue
Block a user