Fix error when snapshot exists with an underscore in the name

This commit is contained in:
grossmj committed 2024-07-05 12:04:53 +02:00
1 parent 84efc55d02
commit 08154e43aa
4 files changed
+17 -9

No files matched your search

+5 -1
View File
@@ -192,7 +192,11 @@ class Project:
if os.path.exists(snapshot_dir):
for snap in os.listdir(snapshot_dir):
if snap.endswith(".gns3project"):
snapshot = Snapshot(self, filename=snap)
try:
snapshot = Snapshot(self, filename=snap)
except ValueError:
log.error("Invalid snapshot file: {}".format(snap))
continue
self._snapshots[snapshot.id] = snapshot
# Create the project on demand on the compute node