Do not require the local server param to open a .gns3 file. Fixes https://github.com/GNS3/gns3-gui/issues/2421 Ref #1460

This commit is contained in:
grossmj committed 2021-12-10 15:52:57 +10:30
1 parent 16fcf6141e
commit ab4d964d69
3 files changed
+9 -8

No files matched your search

+7 -1
View File
@@ -519,6 +519,9 @@ class Controller:
:param load: Load the topology
"""
if not os.path.exists(path):
raise ControllerError(f"'{path}' does not exist on the controller")
topo_data = load_topology(path)
topo_data.pop("topology")
topo_data.pop("version")
@@ -529,7 +532,10 @@ class Controller:
project = self._projects[topo_data["project_id"]]
else:
project = await self.add_project(
path=os.path.dirname(path), status="closed", filename=os.path.basename(path), **topo_data
path=os.path.dirname(path),
status="closed",
filename=os.path.basename(path),
**topo_data
)
if load or project.auto_open:
await project.open()