diff --git a/devices/org.osbuild.loopback b/devices/org.osbuild.loopback index 7332d281..807208a1 100755 --- a/devices/org.osbuild.loopback +++ b/devices/org.osbuild.loopback @@ -18,11 +18,10 @@ documentation for `osbuil.util.udev.UdevInhibitor`. import argparse -import errno import os import sys -from typing import Dict, Optional +from typing import Dict from osbuild import devices from osbuild import loop @@ -64,6 +63,9 @@ class LoopbackService(devices.DeviceService): def __init__(self, args: argparse.Namespace): super().__init__(args) self.ctl = loop.LoopControl() + self.fd = None + self.lo = None + self.sector_size = None @staticmethod def setup_loop(lo: loop.Loop): diff --git a/devices/org.osbuild.luks2 b/devices/org.osbuild.luks2 index 56baeb61..8c44131f 100755 --- a/devices/org.osbuild.luks2 +++ b/devices/org.osbuild.luks2 @@ -140,11 +140,11 @@ class CryptDeviceService(devices.DeviceService): self.devname = None # finally close the device - res = subprocess.run(["cryptsetup", "-q", "close", name], - check=self.check, - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - encoding="UTF-8") + subprocess.run(["cryptsetup", "-q", "close", name], + check=self.check, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + encoding="UTF-8") def main(): diff --git a/inputs/org.osbuild.ostree b/inputs/org.osbuild.ostree index 53983abf..326cc701 100755 --- a/inputs/org.osbuild.ostree +++ b/inputs/org.osbuild.ostree @@ -133,7 +133,7 @@ class OSTreeInput(inputs.InputService): if origin == "org.osbuild.pipeline": for ref, options in refs.items(): source = store.read_tree(ref) - with open(os.path.join(source, "compose.json"), "r") as f: + with open(os.path.join(source, "compose.json"), "r", encoding="utf8") as f: compose = json.load(f) commit_id = compose["ostree-commit"] reply = export({commit_id: options}, source, target) diff --git a/inputs/org.osbuild.ostree.checkout b/inputs/org.osbuild.ostree.checkout index 843afb48..fc90b8fa 100755 --- a/inputs/org.osbuild.ostree.checkout +++ b/inputs/org.osbuild.ostree.checkout @@ -105,7 +105,7 @@ class OSTreeCheckoutInput(inputs.InputService): if origin == "org.osbuild.pipeline": for ref, options in refs.items(): source = store.read_tree(ref) - with open(os.path.join(source, "compose.json"), "r") as f: + with open(os.path.join(source, "compose.json"), "r", encoding="utf8") as f: compose = json.load(f) commit_id = compose["ostree-commit"] ids.append(checkout({commit_id: options}, source, target)) diff --git a/mounts/org.osbuild.noop b/mounts/org.osbuild.noop index 16dc0cca..7793010c 100755 --- a/mounts/org.osbuild.noop +++ b/mounts/org.osbuild.noop @@ -34,6 +34,7 @@ SCHEMA_2 = """ class NoOpMount(mounts.MountService): + mountpoint = None def mount(self, args: Dict): root = args["root"] diff --git a/mounts/org.osbuild.ostree.deployment b/mounts/org.osbuild.ostree.deployment index 9a21f677..b328ef30 100755 --- a/mounts/org.osbuild.ostree.deployment +++ b/mounts/org.osbuild.ostree.deployment @@ -104,8 +104,6 @@ class OSTreeDeploymentMount(mounts.MountService): self.mountpoint = tree self.check = True - return None - def umount(self): if not self.mountpoint: