Actually, you know, return the timeout
self.getTimeout isn't any good without a return statement. Change-Id: Icd62967043df7ac69ec706440eafba66049b0052
This commit is contained in:
parent
d2194b283c
commit
7c9824c837
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue