Merge pull request #853 from calavera/fix_progress_status

Fix importing progress status check
This commit is contained in:
Mitchell Hashimoto 2012-04-02 09:51:00 -07:00
commit fa14133ceb
2 changed files with 3 additions and 1 deletions

View File

@ -173,6 +173,7 @@ module Vagrant
# The progress of the import will be in the last line. Do a greedy # The progress of the import will be in the last line. Do a greedy
# regular expression to find what we're looking for. # regular expression to find what we're looking for.
if current = lines.last[/.+(\d{2})%/, 1] if current = lines.last[/.+(\d{2})%/, 1]
current = current.to_i
if current > last if current > last
last = current last = current
yield current if block_given? yield current if block_given?

View File

@ -173,6 +173,7 @@ module Vagrant
# The progress of the import will be in the last line. Do a greedy # The progress of the import will be in the last line. Do a greedy
# regular expression to find what we're looking for. # regular expression to find what we're looking for.
if current = lines.last[/.+(\d{2})%/, 1] if current = lines.last[/.+(\d{2})%/, 1]
current = current.to_i
if current > last if current > last
last = current last = current
yield current if block_given? yield current if block_given?
@ -385,7 +386,7 @@ module Vagrant
def read_vms def read_vms
results = [] results = []
execute("list", "vms", :retryable => true).split("\n").each do |line| execute("list", "vms", :retryable => true).split("\n").each do |line|
if vm line[/^".+?" \{(.+?)\}$/, 1] if vm = line[/^".+?" \{(.+?)\}$/, 1]
results << vm results << vm
end end
end end