From f761ab9f31f2779e0a1dcad76752f0031cf56d16 Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 13 Feb 2018 11:21:18 +0000 Subject: plans: fix path to 'templates' for rendering test plan Use absolute path when resolving location of 'templates' directory for rendering test plan to HTML Change-Id: I02a057b9c6f9a4081a554050470d13aef2b46533 Signed-off-by: Milosz Wasilewski --- plans/testplan2html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plans') diff --git a/plans/testplan2html.py b/plans/testplan2html.py index 39bf7cb..4b4e180 100644 --- a/plans/testplan2html.py +++ b/plans/testplan2html.py @@ -9,7 +9,8 @@ from jinja2 import Environment, FileSystemLoader def render(obj, template="testplan.html", name=None): if name is None: name = template - _env = Environment(loader=FileSystemLoader('templates')) + templates_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") + _env = Environment(loader=FileSystemLoader(templates_dir)) _template = _env.get_template(template) _obj = _template.render(obj=obj) with open("{}".format(name), "wb") as _file: -- cgit v1.2.3