From 85868e07a9a4641c845ad1be3d036e716ff89bad Mon Sep 17 00:00:00 2001 From: Andrew Taumoefolau Date: Wed, 4 May 2016 15:14:28 +1000 Subject: [PATCH] Don't assume a task with non-dict loop results has been skipped. This changeset addresses the issue reported here: ansible/ansible-modules-core#1765 The yum module (at least) includes its task results as strings, rather than dicts, and the code this changeset replaces assumed that in that instance the task was skipped. The updated behaviour assumes that the task has been skipped only if: * results exist, and * all results are dicts that include a truthy skipped value --- lib/ansible/executor/task_result.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/executor/task_result.py b/lib/ansible/executor/task_result.py index da9ab2a11ab..db73f1ccb95 100644 --- a/lib/ansible/executor/task_result.py +++ b/lib/ansible/executor/task_result.py @@ -41,11 +41,8 @@ class TaskResult: def is_skipped(self): if 'results' in self._result and self._task.loop: - flag = True - for res in self._result.get('results', []): - if isinstance(res, dict): - flag &= res.get('skipped', False) - return flag + results = self._result['results'] + return results and all(isinstance(res, dict) and res.get('skipped', False) for res in results) else: return self._result.get('skipped', False)