mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-29 02:08:10 +00: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
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user