From 603ba68f185621d2054d5bfd56a67c513e43e9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Mon, 9 Mar 2020 17:36:38 +0100 Subject: [PATCH] templates: load from `templates/` directory --- lxc_net/network.py | 2 +- lxc_net/xml_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lxc_net/network.py b/lxc_net/network.py index 53a2af2..8c6e3c5 100644 --- a/lxc_net/network.py +++ b/lxc_net/network.py @@ -27,7 +27,7 @@ class Network(util.LibvirtObject): if self.lxc_network: raise self.AlreadyExists() - xml = XMLTemplate("templates/network.xml").inst( + xml = XMLTemplate("network.xml").inst( name=self.name, uuid=self.uuid, bridge_id=self.bridge_id, diff --git a/lxc_net/xml_template.py b/lxc_net/xml_template.py index b6508b3..20587a3 100644 --- a/lxc_net/xml_template.py +++ b/lxc_net/xml_template.py @@ -7,7 +7,7 @@ import jinja2 class XMLTemplate: """ Reads and instanciates a template from a file """ - base_path = os.path.dirname(os.path.abspath(__file__)) + base_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") env = jinja2.Environment( loader=jinja2.FileSystemLoader(base_path), autoescape=jinja2.select_autoescape(