summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-04-06 12:51:34 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2020-04-06 13:00:48 +0200
commitef06d8d706e734f8a587ed8118ffdcbfe80f7a30 (patch)
tree1c4b3c7c2e8387e5496f9cc43be09826334e1444
parent85c09eaed9d7cfaab757baa524463c426c6520ae (diff)
Fix case when vcs_branch is not set
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Change-Id: I9d6f5cb51501b1cdfd9a643c28af96c48323704f
-rw-r--r--utils/agljobtemplate.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/agljobtemplate.py b/utils/agljobtemplate.py
index 9c59b3f..c291a6a 100644
--- a/utils/agljobtemplate.py
+++ b/utils/agljobtemplate.py
@@ -186,8 +186,10 @@ class Agljobtemplate(object):
if vcs_commit is not None:
job['vcs_commit'] = vcs_commit
+ machine_branch = None
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 +225,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"))