Summary
preconfig.py hardcodes FileSystemLoader("templates"), so --jinja ec_preconfig_template.jinja2
fails unless the file is inside ./templates. This causes jinja2.exceptions.TemplateNotFound.
Expected behavior
--jinja should accept:
- an absolute path
- a relative path
- just a filename found in either
. or ./templates
Actual behavior
Raises jinja2.exceptions.TemplateNotFound: ec_preconfig_template.jinja2 unless the file
exists in ./templates.
Steps to reproduce
-
Place ec_preconfig_template.jinja2 in the repo root (not in ./templates)
-
Run: python3 preconfig.py -c my-preconfig.csv --jinja ec_preconfig_template.jinja2 -o <orch_url>
-
Observe TemplateNotFound.
Proposed fix
Allow --jinja to be a path and search in ['<arg parent>', '.', 'templates']. Provide a clear
error message listing the directories searched.
Summary
preconfig.pyhardcodesFileSystemLoader("templates"), so--jinja ec_preconfig_template.jinja2fails unless the file is inside
./templates. This causesjinja2.exceptions.TemplateNotFound.Expected behavior
--jinjashould accept:.or./templatesActual behavior
Raises
jinja2.exceptions.TemplateNotFound: ec_preconfig_template.jinja2unless the fileexists in
./templates.Steps to reproduce
Place
ec_preconfig_template.jinja2in the repo root (not in./templates)Run:
python3 preconfig.py -c my-preconfig.csv --jinja ec_preconfig_template.jinja2 -o <orch_url>Observe
TemplateNotFound.Proposed fix
Allow
--jinjato be a path and search in['<arg parent>', '.', 'templates']. Provide a clearerror message listing the directories searched.