From 2b77b166ded496b26003ca0f08fd823cd87502fd Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Thu, 16 Jun 2022 21:35:40 -0500 Subject: [PATCH] Verify: convert block size assertion to warning --- disk_jumble/src/disk_jumble/verify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.30.2