mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Allow images to be stored in subdirs and used by templates.
This commit is contained in:
1 parent
332fa47b50
commit
d606553e20
8 files changed
+159
-48
No files matched your search
@@ -273,8 +273,9 @@ async def write_image(
|
||||
|
||||
checksum = checksum.hexdigest()
|
||||
duplicate_image = await images_repo.get_image_by_checksum(checksum)
|
||||
if duplicate_image:
|
||||
raise InvalidImageError(f"Image {duplicate_image.filename} with same checksum already exists")
|
||||
if duplicate_image and os.path.dirname(duplicate_image.path) == os.path.dirname(path):
|
||||
raise InvalidImageError(f"Image {duplicate_image.filename} with "
|
||||
f"same checksum already exists in the same directory")
|
||||
except InvalidImageError:
|
||||
os.remove(tmp_path)
|
||||
raise
|
||||
|
||||
Reference in new issue
Block a user