Commit bcad87e5 authored by Frédéric Dalleau's avatar Frédéric Dalleau

Allow the use of Jinja syntax in profiles

Profiles have a lot of repetition in their syntax.
The use of Jinja simplifies profiles and makes them more readable.
Signed-off-by: default avatarFrédéric Dalleau <frederic.dalleau@collabora.com>
parent 1d77d4a5
......@@ -29,6 +29,7 @@ try:
except ImportError:
from urlparse import urlparse
import jinja2.exceptions
import jinja2
import requests
try:
......@@ -59,7 +60,9 @@ class Profiles(object):
# Set yaml configuration
try:
with open(default_config_file) as conf_data:
self.config = yaml.safe_load(conf_data)
env = jinja2.Environment(loader = jinja2.FileSystemLoader('.'))
t = env.get_template(default_config_file)
self.config = yaml.safe_load(t.render())
except EnvironmentError as e:
lqa_logger.error(e)
exit(APPLICATION_ERROR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment