Keep forever .gns3 backup before version upgrade

This commit is contained in:
Julien Duponchelle committed 2016-10-07 11:29:11 +02:00
1 parent 98480881a3
commit a437760f5d
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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)