Fix bug in verify output code
authorJakob Cornell <jakob+gpg@jcornell.net>
Tue, 19 Apr 2022 01:40:02 +0000 (20:40 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Tue, 19 Apr 2022 01:40:02 +0000 (20:40 -0500)
disk_jumble/src/disk_jumble/verify.py

index 10d71ba6bed02d63a39af3f7a1c8b8fb08f7bc01..66cb3faaf88e4a91e55f9c531ba4f71a749c32fc 100644 (file)
@@ -348,13 +348,12 @@ def _do_verify(conn, disk_id: int, target_ranges: Optional[List[range]], disk_fi
        ts = dt.datetime.now(dt.timezone.utc)
        for result in merge_results(generate_results()):
                if isinstance(result, Pass):
-                       pg_block_ranges = [NumericRange(r.start, r.stop) for r in result.blocks]
                        cursor.execute(
                                """
                                        insert into diskjumble.verify_pass (verify_pass_id, at, disk_id, disk_sectors)
                                        values (default, %s, %s, %s)
                                """,
-                               (ts, disk_id, pg_block_ranges)
+                               (ts, disk_id, NumericRange(result.blocks.start, result.blocks.stop))
                        )
                else:
                        assert isinstance(result, Fail)