From 82c14567818bc42762e7e1ed24c9801afc15a06d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 7 Feb 2018 22:57:16 -0800 Subject: [PATCH] If the timeout in _poll_async_result has expired, raise the exception (#35878) --- lib/ansible/executor/task_executor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 7f5c43e8b6..ee9ec6fdd6 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -729,7 +729,12 @@ class TaskExecutor: except AttributeError: pass - time_left -= self._task.poll + # Little hack to raise the exception if we've exhausted the timeout period + time_left -= self._task.poll + if time_left <= 0: + raise + else: + time_left -= self._task.poll if int(async_result.get('finished', 0)) != 1: if async_result.get('_ansible_parsed'):