mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-27 02:32:23 +02:00
Merge pull request #2717 from GNS3/bugfix/2709
Fix snapshot restore does not work after export/import of project
This commit is contained in:
commit
2dcbe0f1c2
@ -316,7 +316,7 @@ async def update_snapshots(snapshots_dir, project_path, project_name, project_id
|
|||||||
topology = json.load(f)
|
topology = json.load(f)
|
||||||
topology["name"] = project_name
|
topology["name"] = project_name
|
||||||
topology["project_id"] = project_id
|
topology["project_id"] = project_id
|
||||||
regenerate_topology_ids(topology, project_path, reset_mac_addresses)
|
regenerate_topology_ids(topology, tmpdir, reset_mac_addresses)
|
||||||
with open(topology_file_path, "w+", encoding="utf-8") as f:
|
with open(topology_file_path, "w+", encoding="utf-8") as f:
|
||||||
json.dump(topology, f, indent=4, sort_keys=True)
|
json.dump(topology, f, indent=4, sort_keys=True)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class Snapshot:
|
|||||||
# delete the current project files
|
# delete the current project files
|
||||||
project_files_path = os.path.join(self._project.path, "project-files")
|
project_files_path = os.path.join(self._project.path, "project-files")
|
||||||
if os.path.exists(project_files_path):
|
if os.path.exists(project_files_path):
|
||||||
await wait_run_in_executor(shutil.rmtree, project_files_path)
|
await wait_run_in_executor(shutil.rmtree, project_files_path, ignore_errors=True)
|
||||||
with open(self._path, "rb") as f:
|
with open(self._path, "rb") as f:
|
||||||
project = await import_project(
|
project = await import_project(
|
||||||
self._project.controller,
|
self._project.controller,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user