]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix reading dropin files
authorfedora Cloud User <fedora@ip-172-31-84-15.ec2.internal>
Mon, 14 Nov 2022 15:27:38 +0000 (15:27 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 14 Nov 2022 15:44:57 +0000 (16:44 +0100)
When using iterdir() we don't have to join the paths anymore

mkosi/__init__.py

index 54e1feae83a4ac5f2bccbd4560fe5f6471dd2aad..2da48c518c3d31ab7c71063668c307cd78c4ce28 100644 (file)
@@ -6032,18 +6032,16 @@ def parse_args_file_group(
 
     for dropin_dir in (d / "mkosi.conf.d", d / "mkosi.default.d"):
         if dropin_dir.is_dir():
-            for file in sorted(dropin_dir.iterdir()):
-                path = dropin_dir / file
-                if path.is_file():
-                    config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
+            for entry in sorted(dropin_dir.iterdir()):
+                if entry.is_file():
+                    config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{entry}"]
 
     if distribution is not None:
         for distribution_dir in (d / "mkosi.conf.d" / str(distribution), d / "mkosi.default.d" / str(distribution)):
             if distribution_dir.is_dir():
-                for subdir in sorted(distribution_dir.iterdir()):
-                    path = distribution_dir / subdir
-                    if path.is_file():
-                        config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{path}"]
+                for entry in sorted(distribution_dir.iterdir()):
+                    if entry.is_file():
+                        config_files += [f"{ArgumentParserMkosi.fromfile_prefix_chars}{entry}"]
 
     # Parse all parameters handled by mkosi.
     # Parameters forwarded to subprocesses such as nspawn or qemu end up in cmdline_argv.