mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Merge origin/3.1 into image-manager-out-of-sync
Preserve image reconciliation, locking, and regression coverage while integrating upstream release, dependency, typing, and formatting updates. Align feature code with the new Ruff checks.
This commit is contained in:
commit
42d30651da
497 files changed
+22962
-24152
No files matched your search
@@ -28,8 +28,9 @@ def fingerprint(path):
|
||||
|
||||
def stat_fingerprint(info):
|
||||
# Store as text: inode/device numbers need not fit a signed SQL BIGINT.
|
||||
return ":".join(str(value) for value in (
|
||||
info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns, info.st_ctime_ns))
|
||||
return ":".join(
|
||||
str(value) for value in (info.st_dev, info.st_ino, info.st_size, info.st_mtime_ns, info.st_ctime_ns)
|
||||
)
|
||||
|
||||
|
||||
class ImageLockBusy(Exception):
|
||||
@@ -61,10 +62,12 @@ class ImageLock:
|
||||
try:
|
||||
if os.name == "nt":
|
||||
import msvcrt
|
||||
|
||||
self._file.seek(0)
|
||||
msvcrt.locking(self._file.fileno(), msvcrt.LK_NBLCK, 1)
|
||||
else:
|
||||
import fcntl
|
||||
|
||||
fcntl.flock(self._file, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||
return self
|
||||
except (BlockingIOError, PermissionError):
|
||||
|
||||
Reference in new issue
Block a user