From: Jakob Cornell Date: Fri, 17 Jun 2022 02:35:40 +0000 (-0500) Subject: Verify: convert block size assertion to warning X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b77b166ded496b26003ca0f08fd823cd87502fd;p=eros.git Verify: convert block size assertion to warning --- diff --git a/disk_jumble/src/disk_jumble/verify.py b/disk_jumble/src/disk_jumble/verify.py index db1bcdc..2ed32f2 100644 --- a/disk_jumble/src/disk_jumble/verify.py +++ b/disk_jumble/src/disk_jumble/verify.py @@ -1,6 +1,7 @@ from __future__ import annotations from dataclasses import dataclass from typing import Iterator, List, Optional +from warnings import warn import argparse import contextlib import hashlib @@ -125,7 +126,8 @@ def _get_v1_worklist(conn, disk_id: int, target_ranges: List[NumericRange]) -> L ] for i in infos: - assert i.piece_length % BLOCK_SIZE == 0, f"entity {i.id.hex()} has invalid piece length" + if i.piece_length % BLOCK_SIZE != 0: + warn(f"entity {i.id.hex()} has invalid piece length") runs = [] cursor = conn.cursor()