From 994dfb84fc01ec0bc7134ebc1c982a0a9ad8b283 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 25 Sep 2013 15:50:24 -0500 Subject: [PATCH] Minor pep8 cleanup and CHANGELOG update for do-until --- CHANGELOG.md | 1 + lib/ansible/runner/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 917f93bbcbf..bf4793d5137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Ansible Changes By Release Highlighted new features: +* Added do-until feature, which can be used to retry a failed task a specified number of times with a delay in-between the retries. * (docs pending) Added failed_when option for tasks, which can be used to specify logical statements that make it easier to determine when a task has failed, or to make it easier to ignore certain non-zero return codes for some commands. * (docs pending) Added the "subelement" lookup plugin, which allows iteration of the keys of a dictionary or items in a list. * Added the capability to use either paramiko or ssh for the inital setup connection of an accelerated playbook. diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index ae636af9301..ac22fb1399c 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -675,11 +675,11 @@ class Runner(object): result.result['attempts'] = x vv("Result from run %i is: %s" % (x, result.result)) if not result.comm_ok: - break; + break inject[self.module_vars.get('register')] = result.result cond = template.template(self.basedir, until, inject, expand_lists=False) if utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars): - break; + break else: result.result['attempts'] = 0 conn.close()