Verify tool: fix SQL parameter type bug
authorJakob Cornell <jakob+gpg@jcornell.net>
Tue, 19 Apr 2022 00:32:23 +0000 (19:32 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Tue, 19 Apr 2022 00:32:23 +0000 (19:32 -0500)
disk_jumble/src/disk_jumble/verify.py

index df6b5f3afdd25d2ce8c30b766ddb441046b1a3b1..10d71ba6bed02d63a39af3f7a1c8b8fb08f7bc01 100644 (file)
@@ -348,12 +348,13 @@ 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, result.blocks)
+                               (ts, disk_id, pg_block_ranges)
                        )
                else:
                        assert isinstance(result, Fail)