Hello,I have attached a debdiff where I replace the broad exception types with appropriate error types. This patch satisfies the pylint test and allows the package to build without issues. I can upload this RC bug fix as a NMU if you want. Thanks!
-- Josef Schneider GPG Fingerprint 3267 0331 DB61 A817 7D25 4D05 5A44 BC12 F2A8 E58F
diff -Nru image-factory-1.0.2/debian/changelog image-factory-1.0.2/debian/changelog --- image-factory-1.0.2/debian/changelog 2021-11-12 16:52:40.000000000 +0100 +++ image-factory-1.0.2/debian/changelog 2023-04-12 15:50:18.000000000 +0200 @@ -1,3 +1,11 @@ +image-factory (1.0.2-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * debian/patches: Add 0001-replace-broad-exceptions.patch. + + Pass pylint test and fix FTBFS (Closes: #1033424). + + -- Josef Schneider <josef81...@gmail.com> Wed, 12 Apr 2023 15:50:18 +0200 + image-factory (1.0.2-1) unstable; urgency=medium * New upstream release diff -Nru image-factory-1.0.2/debian/patches/0001-replace-broad-exceptions.patch image-factory-1.0.2/debian/patches/0001-replace-broad-exceptions.patch --- image-factory-1.0.2/debian/patches/0001-replace-broad-exceptions.patch 1970-01-01 01:00:00.000000000 +0100 +++ image-factory-1.0.2/debian/patches/0001-replace-broad-exceptions.patch 2023-04-12 15:50:18.000000000 +0200 @@ -0,0 +1,43 @@ +From a32952d31c02d2ce2425032e1960c0c292a29855 Mon Sep 17 00:00:00 2001 +From: Josef Schneider <josef81...@gmail.com> +Date: Wed, 12 Apr 2023 15:49:41 +0200 +Subject: [PATCH] replace broad exceptions + +--- + image-factory | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/image-factory b/image-factory +index f8dffe0..5130fd7 100755 +--- a/image-factory ++++ b/image-factory +@@ -61,7 +61,7 @@ def get_config(): + if env_name in os.environ: + config_files = [os.environ[env_name]] + if not os.path.isfile(config_files[0]): +- raise Exception( ++ raise FileNotFoundError( + "'" + config_files[0] + "' (set in " + env_name + ") is not a valid file." + ) + else: +@@ -135,7 +135,7 @@ def cache_file(cache_dir, source): + elif source.startswith("rsync:"): + call_command(["rsync", "--no-motd", source, destination]) + else: +- raise Exception(f"No download handler for file '{source}' found.") ++ raise ValueError(f"No download handler for file '{source}' found.") + return relative_destination + + +@@ -163,7 +163,7 @@ def download_and_publish(config, image, source, filename): + elif source.startswith("rsync:"): + call_command(["rsync", "--no-motd", source, destination]) + else: +- raise Exception(f"No download handler for file '{source}' found.") ++ raise ValueError(f"No download handler for file '{source}' found.") + return destination + + +-- +2.38.1 + diff -Nru image-factory-1.0.2/debian/patches/series image-factory-1.0.2/debian/patches/series --- image-factory-1.0.2/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ image-factory-1.0.2/debian/patches/series 2023-04-12 15:50:18.000000000 +0200 @@ -0,0 +1 @@ +0001-replace-broad-exceptions.patch
OpenPGP_0x5A44BC12F2A8E58F.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature