templates: load from templates/
directory
This commit is contained in:
parent
e310032b36
commit
603ba68f18
2 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ class Network(util.LibvirtObject):
|
||||||
if self.lxc_network:
|
if self.lxc_network:
|
||||||
raise self.AlreadyExists()
|
raise self.AlreadyExists()
|
||||||
|
|
||||||
xml = XMLTemplate("templates/network.xml").inst(
|
xml = XMLTemplate("network.xml").inst(
|
||||||
name=self.name,
|
name=self.name,
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
bridge_id=self.bridge_id,
|
bridge_id=self.bridge_id,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import jinja2
|
||||||
class XMLTemplate:
|
class XMLTemplate:
|
||||||
""" Reads and instanciates a template from a file """
|
""" 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(
|
env = jinja2.Environment(
|
||||||
loader=jinja2.FileSystemLoader(base_path),
|
loader=jinja2.FileSystemLoader(base_path),
|
||||||
autoescape=jinja2.select_autoescape(
|
autoescape=jinja2.select_autoescape(
|
||||||
|
|
Loading…
Reference in a new issue