summaryrefslogtreecommitdiffstats
path: root/utils/agljobtemplate.py
diff options
context:
space:
mode:
authorKhouloud Touil <ktouil@baylibre.com>2019-04-12 17:39:17 +0200
committerKhouloud Touil <ktouil@baylibre.com>2019-04-16 18:18:33 +0200
commitefc7c3ec0f837eabe430a966da82672ab28c0f32 (patch)
treec92938dfa6bbb1136ddf65391a2d3cb99bf26da7 /utils/agljobtemplate.py
parent00b180b4e29603da12f4e6aa78dca1fed32d809f (diff)
Modify the releng-scripts to deal with branches and dtb names
This patch takes the branch and machine arguments and decide which is the dtb name to be used. Change-Id: I09bd67de51920c81780a77be396906a15d8247f5 Signed-off-by: Khouloud Touil <ktouil@baylibre.com>
Diffstat (limited to 'utils/agljobtemplate.py')
-rw-r--r--utils/agljobtemplate.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/agljobtemplate.py b/utils/agljobtemplate.py
index e79db41..0dcafb5 100644
--- a/utils/agljobtemplate.py
+++ b/utils/agljobtemplate.py
@@ -50,6 +50,7 @@ class Agljobtemplate(object):
DEFAULT_PATH = "templates"
CALLBACK_DIR = "callback"
MACHINES_DIR = "machines"
+ MACHINES_BRANCH_DIR = "machines-branch"
TESTS_DIR = "tests"
RFS_TYPE = ['nbd', 'ramdisk']
@@ -207,6 +208,12 @@ class Agljobtemplate(object):
env = jinja2.Environment(loader=jinja2.FileSystemLoader(self._template_path))
env.filters['get_extension'] = get_extension
- template = env.get_template(os.path.join(self.MACHINES_DIR, machine + ".jinja2"))
+
+ machine_branch = machine + '-' + vcs_branch + '.jinja2'
+
+ if machine_branch in os.listdir(os.path.join(self._template_path, self.MACHINES_DIR, self.MACHINES_BRANCH_DIR)):
+ template = env.get_template(os.path.join(self.MACHINES_DIR, self.MACHINES_BRANCH_DIR, machine_branch))
+ else:
+ template = env.get_template(os.path.join(self.MACHINES_DIR, machine + ".jinja2"))
return template.render(job)