Invert check for templates

Look for template with .j2 suffix before reverting the legacy
non-suffixed behaviour.
This commit is contained in:
James Page 2021-10-11 11:00:12 +01:00
parent d1b7be4fea
commit 78774b55e7
1 changed files with 2 additions and 2 deletions

View File

@ -43,10 +43,10 @@ def sidecar_config_render(containers, container_configs, template_dir,
for container_name in config.container_names:
try:
template = _tmpl_env.get_template(
os.path.basename(config.path))
os.path.basename(config.path) + '.j2')
except jinja2.exceptions.TemplateNotFound:
template = _tmpl_env.get_template(
os.path.basename(config.path) + '.j2')
os.path.basename(config.path))
container = get_container(containers, container_name)
contents = template.render(adapters)
kwargs = {