From 084a3e13b06859d995ff3ea239c98ae2a2aefe05 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 23 Jun 2016 18:07:11 -0500 Subject: [PATCH] Fix off-by-one error with retries Fixes #16408 (cherry picked from commit 948682dbe20a693c011f4fde5604debeafd3a524) --- lib/ansible/executor/task_executor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index db8ab9b7fa1..f677c9d6b3e 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -424,9 +424,11 @@ class TaskExecutor: # Read some values from the task, so that we can modify them if need be if self._task.until: - retries = self._task.retries + retries = self._task.retries + 1 if retries is None: retries = 3 + elif retries <= 0: + retries = 1 else: retries = 1