summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ansible/executor/task_result.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/ansible/executor/task_result.py b/lib/ansible/executor/task_result.py
index da9ab2a11a..db73f1ccb9 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)