On import/export, hide "parts" of progress (since its simply out of 100)
This commit is contained in:
parent
f8dee9adf9
commit
d5e2a64fd3
|
@ -36,7 +36,7 @@ module Vagrant
|
|||
def export
|
||||
logger.info "Exporting VM to #{ovf_path}..."
|
||||
@runner.vm.export(ovf_path) do |progress|
|
||||
update_progress(progress, 100)
|
||||
update_progress(progress, 100, false)
|
||||
end
|
||||
|
||||
complete_progress
|
||||
|
|
|
@ -10,7 +10,7 @@ module Vagrant
|
|||
logger.info "Importing base VM (#{@runner.env.box.ovf_file})..."
|
||||
# Use the first argument passed to the action
|
||||
@runner.vm = VirtualBox::VM.import(@runner.env.box.ovf_file) do |progress|
|
||||
update_progress(progress, 100)
|
||||
update_progress(progress, 100, false)
|
||||
end
|
||||
|
||||
complete_progress
|
||||
|
|
|
@ -13,9 +13,10 @@ module Vagrant
|
|||
#
|
||||
# @param [Float] progress Progress
|
||||
# @param [Float] total Total
|
||||
def update_progress(progress, total)
|
||||
def update_progress(progress, total, show_parts=true)
|
||||
percent = (progress.to_f / total.to_f) * 100
|
||||
print "#{CL_RESET}Progress: #{percent.to_i}% (#{progress} / #{total})"
|
||||
print "#{CL_RESET}Progress: #{percent.to_i}%"
|
||||
print " (#{progress} / #{total})" if show_parts
|
||||
$stdout.flush
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue