Task: 47875

Story: 2010711
Search for included files relative to the current job first

Change-Id: I34a5743967bf7cbb8b464a0a36abad24180d61e4
Signed-off-by: Max Trunov <trunov_ms@taximaxim.ru>
This commit is contained in:
Max Trunov 2023-04-28 10:23:36 +05:00
parent 2f8ac26e86
commit 2470a463a6
1 changed files with 9 additions and 0 deletions

View File

@ -282,6 +282,15 @@ class BaseYamlObject(metaclass=abc.ABCMeta):
def _find_file(self, rel_path, pos):
search_path = self._search_path
current_path = Path(pos.path)
candidate = current_path.parent.joinpath(rel_path)
if candidate.is_file():
logger.debug(
"Including file %r from path %r",
str(rel_path),
str(current_path.parent),
)
return candidate
if "." not in search_path:
search_path.append(".")
dir_list = [Path(d).expanduser() for d in self._search_path]