mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Do not reload a project if project is already opened
Ref https://github.com/GNS3/gns3-gui/issues/1251
This commit is contained in:
4 files changed
+34
-1
No files matched your search
@@ -217,7 +217,10 @@ class Controller:
|
||||
topo_data.pop("revision")
|
||||
topo_data.pop("type")
|
||||
|
||||
project = yield from self.add_project(path=os.path.dirname(path), status="closed", filename=os.path.basename(path), **topo_data)
|
||||
if topo_data["project_id"] in self._projects:
|
||||
project = self._projects[topo_data["project_id"]]
|
||||
else:
|
||||
project = yield from self.add_project(path=os.path.dirname(path), status="closed", filename=os.path.basename(path), **topo_data)
|
||||
if load:
|
||||
yield from project.open()
|
||||
return project
|
||||
|
||||
@@ -337,6 +337,9 @@ class Project:
|
||||
"""
|
||||
Load topology elements
|
||||
"""
|
||||
if self._status == "opened":
|
||||
return
|
||||
|
||||
self.reset()
|
||||
path = self._topology_file()
|
||||
if os.path.exists(path):
|
||||
|
||||
Reference in new issue
Block a user