Add back timeout_var logic

We still need to setup our timeout-var environmental variable,
otherwise devstack gate will fail to read BUILD_TIMEOUT and default
jobs to 120min timeouts.

Change-Id: Ieccba55eaab83074a409efdbb928b4a4fdfdecf7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-10-20 06:12:33 -04:00
parent 280cd8d062
commit 7aaf5d2f76
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
1 changed files with 4 additions and 0 deletions

View File

@ -1341,15 +1341,19 @@ class NodeWorker(object):
inventory.write('\n')
timeout = None
timeout_var = None
for wrapper in jjb_job.get('wrappers', []):
if isinstance(wrapper, dict):
build_timeout = wrapper.get('timeout')
if isinstance(build_timeout, dict):
timeout_var = build_timeout.get('timeout-var')
timeout = build_timeout.get('timeout')
if timeout is not None:
timeout = int(timeout) * 60
if not timeout:
timeout = ANSIBLE_DEFAULT_TIMEOUT
if timeout_var:
parameters[timeout_var] = str(timeout * 1000)
with open(jobdir.vars, 'w') as vars_yaml:
variables = dict(