From 0062198f735c1acba65c31c6da99c36e0c4907c7 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Thu, 21 May 2020 22:25:11 +0530 Subject: [PATCH] Typecast results before use in profile_tasks callback (#26) If user specifies sort_order to none, results are not converted to list. This fix force this typecasting before using the results. Fixes: https://github.com/ansible/ansible/issues/69563 Signed-off-by: Abhijeet Kasurde --- plugins/callback/profile_tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/callback/profile_tasks.py b/plugins/callback/profile_tasks.py index 9433b96..6edb325 100644 --- a/plugins/callback/profile_tasks.py +++ b/plugins/callback/profile_tasks.py @@ -46,7 +46,7 @@ EXAMPLES = ''' example: > To enable, add this to your ansible.cfg file in the defaults block [defaults] - callback_whitelist = profile_tasks + callback_whitelist = ansible.posix.profile_tasks sample output: > # # TASK: [ensure messaging security group exists] ******************************** @@ -183,7 +183,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: