mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-24 06:44:34 +02:00
Merge pull request #1119 from GNS3/fix_random_snap_failure
Test if a snapshot name already exists
This commit is contained in:
commit
d525f721a6
1 file changed
+3
@@ -510,6 +510,9 @@ class Project:
|
||||
:param name: Name of the snapshot
|
||||
"""
|
||||
|
||||
if name in [snap.name for snap in self.snapshots.values()]:
|
||||
raise aiohttp.web_exceptions.HTTPConflict(text="The snapshot {} already exist".format(name))
|
||||
|
||||
snapshot = Snapshot(self, name=name)
|
||||
try:
|
||||
if os.path.exists(snapshot.path):
|
||||
|
||||
Reference in new issue
Block a user