mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Keep forever .gns3 backup before version upgrade
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -98,7 +98,7 @@ def load_topology(path):
|
||||
if "revision" not in topo or topo["revision"] < GNS3_FILE_FORMAT_REVISION:
|
||||
# If it's an old GNS3 file we need to convert it
|
||||
# first we backup the file
|
||||
shutil.copy(path, path + ".backup")
|
||||
shutil.copy(path, path + ".backup{}".format(topo.get("revision", 0)))
|
||||
topo = _convert_1_3_later(topo, path)
|
||||
with open(path, "w+", encoding="utf-8") as f:
|
||||
json.dump(topo, f)
|
||||
|
||||
Reference in new issue
Block a user