Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Set loader on local copy of jinja environment #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion nornir_jinja2/plugins/tasks/template_file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
from typing import Any, Optional, Dict, Callable

from nornir.core.task import Result, Task
Expand Down Expand Up @@ -32,7 +33,7 @@ def template_file(
jinja_filters = jinja_filters or {}

if jinja_env:
env = jinja_env
env = copy.deepcopy(jinja_env)
env.loader = FileSystemLoader(path)
else:
env = Environment(
Expand Down