diff --git a/assemblers/org.osbuild.qemu b/assemblers/org.osbuild.qemu index 1d383892..f568f07d 100755 --- a/assemblers/org.osbuild.qemu +++ b/assemblers/org.osbuild.qemu @@ -305,6 +305,8 @@ class PartitionTable: prep_type = "41" elif self.label == "gpt": prep_type = "9E1A2D38-C612-4316-AA26-8B49521E5A8B" + else: + raise RuntimeError(f"Unknown partition table type: {self.label}") for part in self.partitions: if part.type.upper() == prep_type: diff --git a/inputs/org.osbuild.tree b/inputs/org.osbuild.tree index f954f309..8d456838 100755 --- a/inputs/org.osbuild.tree +++ b/inputs/org.osbuild.tree @@ -79,6 +79,7 @@ class TreeInput(inputs.InputService): # and we have exactly one reference, i.e. a pipeline id pid, _ = refs.popitem() + path = None if pid: path = store.read_tree_at(pid, target) diff --git a/stages/org.osbuild.sfdisk b/stages/org.osbuild.sfdisk index 188cdc88..a669ea7e 100755 --- a/stages/org.osbuild.sfdisk +++ b/stages/org.osbuild.sfdisk @@ -53,6 +53,8 @@ class PartitionTable: prep_type = "41" elif self.label == "gpt": prep_type = "9E1A2D38-C612-4316-AA26-8B49521E5A8B" + else: + raise RuntimeError(f"Unknown partition table type: {self.label}") for part in self.partitions: if part.type.upper() == prep_type: diff --git a/stages/org.osbuild.systemd.unit b/stages/org.osbuild.systemd.unit index c4512a7a..dd9f295b 100755 --- a/stages/org.osbuild.systemd.unit +++ b/stages/org.osbuild.systemd.unit @@ -20,6 +20,10 @@ def main(tree, options): unit_dropins_dir = f"{tree}/usr/lib/systemd/system/{unit}.d" elif unit_type == "global": unit_dropins_dir = f"{tree}/usr/lib/systemd/user/{unit}.d" + else: + print(f"Error: Unknown unit type: {unit_type}") + return 1 + os.makedirs(unit_dropins_dir, exist_ok=True) # We trick configparser into letting us write multiple instances of the same option by writing them as keys with no diff --git a/test/mod/test_meta.py b/test/mod/test_meta.py index 419199a6..9901e6db 100644 --- a/test/mod/test_meta.py +++ b/test/mod/test_meta.py @@ -206,6 +206,7 @@ def make_fake_meta_json(tmp_path, name, version, invalid=""): "not": "following schema" """ + # pylint: disable=possibly-used-before-assignment meta_json_path.write_text(""" { "summary": "some json summary",