From 3c29bbc4d5fc016f24f92ce8b48c1eaabd299468 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 6 Feb 2025 20:50:11 +0200 Subject: [PATCH] extra_data: Adjust path when copying extra_data can be either relative or absolute. We assume users specify extra_data content relative to the directory in which the target topology definition is located. Previously, extra_data relied on the current work directory of the ipalab-config tool which might be different, especially in github actions. Signed-off-by: Alexander Bokovoy --- ipalab_config/__main__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ipalab_config/__main__.py b/ipalab_config/__main__.py index f1dc791..f24d15c 100644 --- a/ipalab_config/__main__.py +++ b/ipalab_config/__main__.py @@ -240,9 +240,16 @@ def generate_ipalab_configuration(): # process user extra_data if "extra_data" in data: - cwd = os.getcwd() + cwd = os.path.dirname(args.CONFIG) for helper in data["extra_data"]: - copy_helper_files(base_dir, helper, source=cwd) + if os.path.isabs(helper): + copy_helper_files( + base_dir, + os.path.basename(helper), + source=os.path.dirname(helper), + ) + else: + copy_helper_files(base_dir, helper, source=cwd) def main():