diff --git a/changelogs/fragments/59059_profile_tasks.yml b/changelogs/fragments/59059_profile_tasks.yml new file mode 100644 index 00000000000..64906383bfa --- /dev/null +++ b/changelogs/fragments/59059_profile_tasks.yml @@ -0,0 +1,2 @@ +bugfixes: +- profile_tasks - typecast result before slicing it (https://github.com/ansible/ansible/issues/59059). diff --git a/lib/ansible/plugins/callback/profile_tasks.py b/lib/ansible/plugins/callback/profile_tasks.py index dad832df4d5..28b086a4bac 100644 --- a/lib/ansible/plugins/callback/profile_tasks.py +++ b/lib/ansible/plugins/callback/profile_tasks.py @@ -173,7 +173,7 @@ class CallbackModule(CallbackBase): timestamp(self) self.current = None - results = self.stats.items() + results = list(self.stats.items()) # Sort the tasks by the specified sort if self.sort_order is not None: