diff --git a/lib/ansible/plugins/callback/profile_tasks.py b/lib/ansible/plugins/callback/profile_tasks.py index f873b75ead0..28aec1c7df2 100644 --- a/lib/ansible/plugins/callback/profile_tasks.py +++ b/lib/ansible/plugins/callback/profile_tasks.py @@ -53,8 +53,8 @@ def tasktime(): time_current = time.strftime('%A %d %B %Y %H:%M:%S %z') time_elapsed = secondsToStr(time.time() - tn) time_total_elapsed = secondsToStr(time.time() - t0) - display(filled('%s (%s)%s%s' % (time_current, time_elapsed, ' ' * 7, time_total_elapsed))) tn = time.time() + return filled('%s (%s)%s%s' % (time_current, time_elapsed, ' ' * 7, time_total_elapsed)) class CallbackModule(CallbackBase): @@ -77,7 +77,7 @@ class CallbackModule(CallbackBase): """ Logs the start of each task """ - tasktime() + self._display.display(tasktime()) timestamp(self) # Record the start time of the current task @@ -85,11 +85,11 @@ class CallbackModule(CallbackBase): self.stats[self.current] = time.time() def playbook_on_setup(self): - tasktime() + self._display.display(tasktime()) def playbook_on_stats(self, stats): - tasktime() - display(filled("", fchar="=")) + self._display.display(tasktime()) + self._display.display(filled("", fchar="=")) timestamp(self) @@ -105,7 +105,7 @@ class CallbackModule(CallbackBase): # Print the timings for name, elapsed in results: - self.display.display( + self._display.display( "{0:-<70}{1:->9}".format( '{0} '.format(name), ' {0:.02f}s'.format(elapsed),