From 13c070948b5f8e22d853a85b6b711b0ead2b3ac9 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Wed, 7 Jun 2017 21:20:59 -0500 Subject: [PATCH] Fix pep8 issues in profile_roles (#25458) * Fix pep8 issues in profile_roles * Fix reduce import --- lib/ansible/plugins/callback/profile_roles.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/callback/profile_roles.py b/lib/ansible/plugins/callback/profile_roles.py index a9b34835b5..26d86595ac 100644 --- a/lib/ansible/plugins/callback/profile_roles.py +++ b/lib/ansible/plugins/callback/profile_roles.py @@ -27,7 +27,7 @@ import collections import time from ansible.plugins.callback import CallbackBase -from ansible.module_utils.six import reduce +from ansible.module_utils.six.moves import reduce # define start time t0 = tn = time.time() @@ -35,7 +35,9 @@ t0 = tn = time.time() def secondsToStr(t): # http://bytes.com/topic/python/answers/635958-handy-short-cut-formatting-elapsed-time-floating-point-seconds - rediv = lambda ll, b: list(divmod(ll[0], b)) + ll[1:] + def rediv(ll, b): + return list(divmod(ll[0], b)) + ll[1:] + return "%d:%02d:%02d.%03d" % tuple( reduce(rediv, [[t * 1000, ], 1000, 60, 60])) @@ -123,4 +125,3 @@ class CallbackModule(CallbackBase): u' {0:.02f}s'.format(total_time)) self._display.display(filled("", fchar="~")) self._display.display(msg_total) -