summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2020-06-17 05:58:47 +0530
committerGitHub <noreply@github.com>2020-06-16 17:28:47 -0700
commitf6829b386ea086ebe849a45b205cf7216900b2dc (patch)
tree3c2d0dde85b7465ae87b6a16a023ac2212deb573
parent6abe3a889d63f25db28dd2826276e3163af08381 (diff)
downloadansible-f6829b386ea086ebe849a45b205cf7216900b2dc.tar.gz
[2.9] Typecast results before use in profile_tasks callback (#69665)
If user specifies sort_order to none, results are not converted to list. This fix force this typecasting before using the results. Fixes: ansible/ansible#69563 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
-rw-r--r--changelogs/fragments/69563_profile_tasks.yml2
-rw-r--r--lib/ansible/plugins/callback/profile_tasks.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/69563_profile_tasks.yml b/changelogs/fragments/69563_profile_tasks.yml
new file mode 100644
index 0000000000..ac4315f6eb
--- /dev/null
+++ b/changelogs/fragments/69563_profile_tasks.yml
@@ -0,0 +1,2 @@
+bugfixes:
+- profile_tasks - typecast results before using it (https://github.com/ansible/ansible/issues/69563).
diff --git a/lib/ansible/plugins/callback/profile_tasks.py b/lib/ansible/plugins/callback/profile_tasks.py
index fedbba7dce..dad832df4d 100644
--- a/lib/ansible/plugins/callback/profile_tasks.py
+++ b/lib/ansible/plugins/callback/profile_tasks.py
@@ -184,7 +184,7 @@ class CallbackModule(CallbackBase):
)
# Display the number of tasks specified or the default of 20
- results = results[:self.task_output_limit]
+ results = list(results)[:self.task_output_limit]
# Print the timings
for uuid, result in results: