From 304c6d2e84eaeecd0e91076e2ab92f16850a0f8c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20Mr=C3=A1zek?= Date: Mon, 30 Jun 2025 21:05:26 +0200 Subject: [PATCH] manager/server.py: check the parent dir of each config file Compare the locations of multiple configuration files and issue a warning --- python/knot_resolver/manager/server.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.47.2