From: fedora Cloud User Date: Mon, 14 Nov 2022 15:27:38 +0000 (+0000) Subject: Fix reading dropin files X-Git-Tag: v15~390^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de12a95314b2ce86699ec8dd8ba3929ab864b20e;p=thirdparty%2Fmkosi.git Fix reading dropin files When using iterdir() we don't have to join the paths anymore --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 54e1feae8..2da48c518 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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.