test: add local 2x2 route topology
This commit is contained in:
@@ -325,6 +325,13 @@ def _ack_name(nonce_owner: str, observer: str) -> str:
|
||||
|
||||
def _atomic_json(path: Path, value: dict[str, Any]) -> None:
|
||||
encoded = json.dumps(value, sort_keys=True, separators=(",", ":"))
|
||||
try:
|
||||
if path.read_text(encoding="utf-8") == encoded:
|
||||
return
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except (OSError, UnicodeError) as exc:
|
||||
raise RouteSetupError("route verification file is unreadable") from exc
|
||||
temporary = path.with_name(
|
||||
f".{path.name}.{os.getpid()}.{uuid.uuid4().hex}.tmp"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user