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
|
def export
|
||||||
logger.info "Exporting VM to #{ovf_path}..."
|
logger.info "Exporting VM to #{ovf_path}..."
|
||||||
@runner.vm.export(ovf_path) do |progress|
|
@runner.vm.export(ovf_path) do |progress|
|
||||||
update_progress(progress, 100)
|
update_progress(progress, 100, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
complete_progress
|
complete_progress
|
||||||
|
|
|
@ -10,7 +10,7 @@ module Vagrant
|
||||||
logger.info "Importing base VM (#{@runner.env.box.ovf_file})..."
|
logger.info "Importing base VM (#{@runner.env.box.ovf_file})..."
|
||||||
# Use the first argument passed to the action
|
# Use the first argument passed to the action
|
||||||
@runner.vm = VirtualBox::VM.import(@runner.env.box.ovf_file) do |progress|
|
@runner.vm = VirtualBox::VM.import(@runner.env.box.ovf_file) do |progress|
|
||||||
update_progress(progress, 100)
|
update_progress(progress, 100, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
complete_progress
|
complete_progress
|
||||||
|
|
|
@ -13,9 +13,10 @@ module Vagrant
|
||||||
#
|
#
|
||||||
# @param [Float] progress Progress
|
# @param [Float] progress Progress
|
||||||
# @param [Float] total Total
|
# @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
|
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
|
$stdout.flush
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue