From 7c9824c83755dec1371ec7ae4dc7aa521acd3ec8 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 22 Sep 2017 15:24:38 -0500 Subject: [PATCH] Actually, you know, return the timeout self.getTimeout isn't any good without a return statement. Change-Id: Icd62967043df7ac69ec706440eafba66049b0052 --- zuul/cmd/migrate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zuul/cmd/migrate.py b/zuul/cmd/migrate.py index 92b5963268..1b2e44ee5e 100644 --- a/zuul/cmd/migrate.py +++ b/zuul/cmd/migrate.py @@ -507,15 +507,19 @@ class Job: self.jjb_job = jobs[self.orig] def getTimeout(self): + timeout = None if self.jjb_job: for wrapper in self.jjb_job.get('wrappers', []): if isinstance(wrapper, dict): - build_timeout = wrapper.get('timeout') + build_timeout = wrapper.get( + 'build-timeout', wrapper.get('timeout')) if isinstance(build_timeout, dict): timeout = build_timeout.get('timeout') if timeout is not None: timeout = int(timeout) * 60 + return timeout + @property def short_name(self): return self.name.replace('legacy-', '') @@ -845,9 +849,11 @@ class Job: if self.vars: output['vars'] = self.vars.copy() + timeout = self.getTimeout() if timeout: output['timeout'] = timeout + output.setdefault('vars', {}) output['vars']['BUILD_TIMEOUT'] = str(timeout * 1000) if self.nodes: