From c716b864564ea3b461039639765e6404b9c5c96c Mon Sep 17 00:00:00 2001 From: Jan-Simon Moeller Date: Mon, 6 Apr 2020 12:51:34 +0200 Subject: Fix case when vcs_branch is not set Signed-off-by: Jan-Simon Moeller Change-Id: I9d6f5cb51501b1cdfd9a643c28af96c48323704f --- utils/agljobtemplate.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/agljobtemplate.py b/utils/agljobtemplate.py index 9c59b3f..deb5ff8 100644 --- a/utils/agljobtemplate.py +++ b/utils/agljobtemplate.py @@ -188,6 +188,7 @@ class Agljobtemplate(object): if vcs_branch is not None: job['vcs_branch'] = vcs_branch + machine_branch = machine + '-' + vcs_branch + '.jinja2' if build_version is not None: job['kernel_version'] = build_version @@ -223,9 +224,7 @@ class Agljobtemplate(object): env = jinja2.Environment(loader=jinja2.FileSystemLoader(self._template_path)) env.filters['get_extension'] = get_extension - 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)): + if machine_branch and 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")) -- cgit 1.2.3-korg