From dc0f33354e5a53d128142881adc1b612f811d3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Thu, 7 Dec 2023 18:29:56 +0100 Subject: [PATCH] Failing to LFS register should abort the import --- lib/lfs_oid.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/lfs_oid.py b/lib/lfs_oid.py index 6f116c7..d487f94 100644 --- a/lib/lfs_oid.py +++ b/lib/lfs_oid.py @@ -68,7 +68,7 @@ class LFSOid: row = cur.fetchone() lfs_oid_id = row[0] cur.execute( - """INSERT INTO lfs_oid_in_package (package,filename,lfs_oid_id) + """INSERT INTO lfs_oid_in_package (package,filename,lfs_oid_id) VALUES (%s,%s,%s)""", (package, filename, lfs_oid_id), ) @@ -133,6 +133,7 @@ class LFSOid: json=data, timeout=10, ) + response.raise_for_status() logging.info(f"Register LFS returned {response.status_code}") @@ -167,7 +168,7 @@ if __name__ == "__main__": cur.execute( """ CREATE TEMPORARY TABLE lfs_oid_in_revision ( - revision_id INTEGER, + revision_id INTEGER, lfs_oid_id INTEGER NOT NULL, name VARCHAR(255) NOT NULL )