From: Aleš Mrázek Date: Mon, 30 Jun 2025 19:05:26 +0000 (+0200) Subject: manager/server.py: check the parent dir of each config file X-Git-Tag: v6.0.15~9^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=304c6d2e84eaeecd0e91076e2ab92f16850a0f8c;p=thirdparty%2Fknot-resolver.git manager/server.py: check the parent dir of each config file Compare the locations of multiple configuration files and issue a warning --- diff --git a/python/knot_resolver/manager/server.py b/python/knot_resolver/manager/server.py index 53fe3ac57..8096f03cc 100644 --- a/python/knot_resolver/manager/server.py +++ b/python/knot_resolver/manager/server.py @@ -568,6 +568,15 @@ async def start_server(config: List[str]) -> int: # noqa: PLR0915 config_data: Dict[str, Any] = {} for file in config_absolute: + # warning about the different parent directories of each config file + # compared to the first one which is used as the prefix path + if config_absolute[0].parent != file.parent: + logger.warning( + f"The configuration file '{file}' has a parent directory that is different" + f" from '{config_absolute[0]}', which is used as the prefix for relative paths." + "This can cause issues with files that are configured with relative paths." + ) + # Preprocess config - load from file or in general take it to the last step before validation. config_raw = await _load_raw_config(file)