]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
fix ruff lint warnings 2073/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 16 Nov 2023 09:43:42 +0000 (10:43 +0100)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Fri, 17 Nov 2023 16:56:59 +0000 (17:56 +0100)
mkosi/burn.py
mkosi/config.py
mkosi/mounts.py

index 08908e9e11bb3a79a83f2eaaf8cf3b31a4c9a89e..ff4c813e8a779b58e93e48763ae37685bba26ef1 100644 (file)
@@ -15,7 +15,7 @@ def run_burn(args: MkosiArgs, config: MkosiConfig) -> None:
     fname = config.output_dir_or_cwd() / config.output
 
     if len(args.cmdline) != 1:
-        die("Expected device argument.");
+        die("Expected device argument.")
 
     device = args.cmdline[0]
 
index ed17ea459eb18e76c19844b6185a04f450328896..0d03a4edbd3da6909f1711f92d646a11b08971bf 100644 (file)
@@ -61,10 +61,28 @@ class Verb(StrEnum):
     burn          = enum.auto()
 
     def supports_cmdline(self) -> bool:
-        return self in (Verb.build, Verb.shell, Verb.boot, Verb.qemu, Verb.ssh, Verb.journalctl, Verb.coredumpctl, Verb.burn)
+        return self in (
+            Verb.build,
+            Verb.shell,
+            Verb.boot,
+            Verb.qemu,
+            Verb.ssh,
+            Verb.journalctl,
+            Verb.coredumpctl,
+            Verb.burn,
+        )
 
     def needs_build(self) -> bool:
-        return self in (Verb.build, Verb.shell, Verb.boot, Verb.qemu, Verb.serve, Verb.journalctl, Verb.coredumpctl, Verb.burn)
+        return self in (
+            Verb.build,
+            Verb.shell,
+            Verb.boot,
+            Verb.qemu,
+            Verb.serve,
+            Verb.journalctl,
+            Verb.coredumpctl,
+            Verb.burn,
+        )
 
     def needs_root(self) -> bool:
         return self in (Verb.shell, Verb.boot, Verb.burn)
@@ -2573,10 +2591,12 @@ def parse_config(argv: Sequence[str] = ()) -> tuple[MkosiArgs, tuple[MkosiConfig
         if any(getattr(config, s) == getattr(cli_ns, s) for config in images):
             continue
 
-        setting = SETTINGS_LOOKUP_BY_DEST[s]
-
-        die(f"{setting.long}={getattr(cli_ns, s)} was specified on the command line but is not allowed to be configured by any images.",
-            hint="Prefix the setting with '@' in the image configuration file to allow overriding it from the command line.")
+        setting = SETTINGS_LOOKUP_BY_DEST[s].long
+        a = getattr(cli_ns, s)
+        die(
+            f"{setting}={a} was specified on the command line but is not allowed to be configured by any images.",
+            hint="Prefix the setting with '@' in the image configuration file to allow overriding it from the command line.", # noqa: E501
+        )
 
     if not images:
         die("No images defined in mkosi.images/")
index e90f57932ad8937e5ba684c4b91690a735e10ec1..ed0a740984d8ea9005e8c019d2cb871f0417573a 100644 (file)
@@ -69,7 +69,11 @@ def mount(
 
 
 @contextlib.contextmanager
-def mount_overlay(lowerdirs: Sequence[Path], upperdir: Optional[Path] = None, where: Optional[Path] = None) -> Iterator[Path]:
+def mount_overlay(
+    lowerdirs: Sequence[Path],
+    upperdir: Optional[Path] = None,
+    where: Optional[Path] = None,
+) -> Iterator[Path]:
     with contextlib.ExitStack() as stack:
         if upperdir is None:
             upperdir = Path(stack.enter_context(tempfile.TemporaryDirectory(prefix="volatile-overlay")))