Add a log message when ansible times out

The watchdog timeout emits an operator log, but no end-user visible
message. Add some text to the error message if we do time out.

Change-Id: I38fed8e020a966362ee708025ab5bc9aa5995c68
This commit is contained in:
Monty Taylor 2016-12-14 12:01:43 -06:00
parent 4afdd8a89d
commit cef224d162
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 5 additions and 1 deletions

View File

@ -1344,7 +1344,10 @@ class NodeWorker(object):
when='success|bool')
blocks[0].insert(0, task)
task = dict(zuul_log=dict(msg="Job complete, result: FAILURE"),
when='not success|bool')
when='not success|bool and not timedout|bool')
blocks[0].insert(0, task)
task = dict(zuul_log=dict(msg="Job timed out, result: FAILURE"),
when='not success|bool and timedout|bool')
blocks[0].insert(0, task)
tasks.append(dict(block=blocks[0],
@ -1506,6 +1509,7 @@ class NodeWorker(object):
cmd = ['ansible-playbook', jobdir.post_playbook,
'-e', 'success=%s' % success,
'-e', 'timedout=%s' % self._watchdog_timeout,
'-e@%s' % jobdir.vars,
verbose]
self.log.debug("Ansible post command: %s" % (cmd,))