mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 23:01:15 +02:00
Fix issues when discovering images
This commit is contained in:
1 parent
466aaf5c13
commit
30f7c0ce74
3 files changed
+8
-3
No files matched your search
@@ -91,6 +91,8 @@ async def get_computes(app: FastAPI) -> List[dict]:
|
||||
def image_filter(change: Change, path: str) -> bool:
|
||||
|
||||
if change == Change.added:
|
||||
if path.endswith(".tmp") or path.endswith(".md5sum") or path.startswith("."):
|
||||
return False
|
||||
header_magic_len = 7
|
||||
with open(path, "rb") as f:
|
||||
image_header = f.read(header_magic_len) # read the first 7 bytes of the file
|
||||
|
||||
Reference in new issue
Block a user