From e6946bc5f2b81ef93178cc7088bb8647b78ee292 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Fri, 9 Feb 2018 14:48:30 +0100 Subject: [PATCH] Fix custom output dir for templates processor Templates processor fails to locate *.j2 files, when a custom output dir is specified. Ensure *.j2 templates are on their expected search paths for upcoming pasring and rendering Change-Id: Idbc93e27574c66a9a5a73e3fcd7e88647282f201 Closes-bug: #1748425 Signed-off-by: Bogdan Dobrelya --- tools/process-templates.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/process-templates.py b/tools/process-templates.py index 8edcd5b990..27db6e7b35 100755 --- a/tools/process-templates.py +++ b/tools/process-templates.py @@ -138,6 +138,12 @@ def process_templates(template_path, role_data_path, output_dir, if not os.path.exists(out_dir): os.mkdir(out_dir) + # Ensure template is on its expected search path + # for upcoming pasring and rendering + for f in files: + if f.endswith('.j2') and output_dir: + shutil.copy(os.path.join(subdir, f), out_dir) + for f in files: file_path = os.path.join(subdir, f) # We do three templating passes here: