Skip to content

Commit c7d8062

Browse files
authored
Merge pull request #1455 from Bastian-Krause/bst/resourceconfig-template-loading
remote/config: simplify ResourceConfig template loading
2 parents 9741924 + 333d9ec commit c7d8062

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

labgrid/remote/config.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ def __attrs_post_init__(self):
2121
line_comment_prefix="##",
2222
)
2323
try:
24-
with open(self.filename) as file:
25-
template = env.from_string(file.read())
26-
except FileNotFoundError:
24+
template = env.get_template(os.path.basename(self.filename))
25+
except jinja2.TemplateNotFound:
2726
raise NoConfigFoundError(f"{self.filename} could not be found")
2827
rendered = template.render(self.template_env)
2928
pprint(("rendered", rendered))

0 commit comments

Comments
 (0)