Commit e6b8d02d authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Show formatted ETA for disk sync and import/export


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 2ad5550d
......@@ -2613,7 +2613,8 @@ def _WaitForSync(lu, instance, disks=None, oneshot=False):
if mstat.sync_percent is not None:
done = False
if mstat.estimated_time is not None:
rem_time = "%d estimated seconds remaining" % mstat.estimated_time
rem_time = ("%s remaining (estimated)" %
utils.FormatSeconds(mstat.estimated_time))
max_time = mstat.estimated_time
else:
rem_time = "no time estimate"
......
......@@ -623,7 +623,7 @@ def FormatProgress(progress):
"""Formats progress information for user consumption
"""
(mbytes, throughput, percent, _) = progress
(mbytes, throughput, percent, eta) = progress
parts = [
utils.FormatUnit(mbytes, "h"),
......@@ -635,7 +635,8 @@ def FormatProgress(progress):
if percent is not None:
parts.append("%d%%" % percent)
# TODO: Format ETA
if eta is not None:
parts.append("ETA %s" % utils.FormatSeconds(eta))
return utils.CommaJoin(parts)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment