From 3fc2209ca03fd55ce9253cacf2df8a2314958cdb Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 27 Oct 2015 15:35:56 -0400 Subject: [PATCH] Fixing retry/until logic and default value for retries Fixes #12928 Fixes #12929 --- lib/ansible/executor/task_executor.py | 7 +++++-- lib/ansible/playbook/task.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index e8a785a02c..2fdc1e9b56 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -325,8 +325,11 @@ class TaskExecutor: self._task.args = dict((i[0], i[1]) for i in iteritems(self._task.args) if i[1] != omit_token) # Read some values from the task, so that we can modify them if need be - retries = self._task.retries - if retries <= 0: + if self._task.until is not None: + retries = self._task.retries + if retries <= 0: + retries = 1 + else: retries = 1 delay = self._task.delay diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index a58e634171..40ca2569c6 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -81,7 +81,7 @@ class Task(Base, Conditional, Taggable, Become): _notify = FieldAttribute(isa='list') _poll = FieldAttribute(isa='int') _register = FieldAttribute(isa='string') - _retries = FieldAttribute(isa='int', default=1) + _retries = FieldAttribute(isa='int', default=3) _until = FieldAttribute(isa='list') # ? def __init__(self, block=None, role=None, task_include=None):