From cef224d1628a73ef70a5d7f06fce16c312859ba5 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 14 Dec 2016 12:01:43 -0600 Subject: [PATCH] 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 --- zuul/launcher/ansiblelaunchserver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zuul/launcher/ansiblelaunchserver.py b/zuul/launcher/ansiblelaunchserver.py index 4d416af0da..95e30b64e0 100644 --- a/zuul/launcher/ansiblelaunchserver.py +++ b/zuul/launcher/ansiblelaunchserver.py @@ -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,))