Fix pep8 issues in profile_roles (#25458)

* Fix pep8 issues in profile_roles

* Fix reduce import
This commit is contained in:
Matt Martz 2017-06-07 21:20:59 -05:00 committed by GitHub
parent 2e920d724d
commit 13c070948b

View file

@ -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)