From e8197c4e87d14bada7a3214136421171896a045b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 22 Jan 2014 19:09:33 -0800 Subject: [PATCH] commands/box: list works with the new versions --- plugins/commands/box/command/list.rb | 8 +++++--- test/unit/vagrant/box_test.rb | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/commands/box/command/list.rb b/plugins/commands/box/command/list.rb index 7b2d09408..5e5c78038 100644 --- a/plugins/commands/box/command/list.rb +++ b/plugins/commands/box/command/list.rb @@ -42,13 +42,15 @@ module VagrantPlugins # ignore the "v1" param for now since I'm not yet sure if its # important for the user to know what boxes need to be upgraded # and which don't, since we plan on doing that transparently. - boxes.each do |name, provider, _v1| - @env.ui.info("#{name.ljust(longest_box_length)} (#{provider})", :prefix => false) + boxes.each do |name, version, provider| + @env.ui.info("#{name.ljust(longest_box_length)} (#{provider})") @env.ui.machine("box-name", name) @env.ui.machine("box-provider", provider) + @env.ui.machine("box-version", version) - info_file = @env.boxes.find(name, provider).directory.join("info.json") + info_file = @env.boxes.find(name, provider, version). + directory.join("info.json") if info_file.file? info = JSON.parse(info_file.read) info.each do |k, v| diff --git a/test/unit/vagrant/box_test.rb b/test/unit/vagrant/box_test.rb index 114a75130..a540476f7 100644 --- a/test/unit/vagrant/box_test.rb +++ b/test/unit/vagrant/box_test.rb @@ -12,7 +12,7 @@ describe Vagrant::Box do let(:name) { "foo" } let(:provider) { :virtualbox } let(:version) { "1.0" } - let(:directory) { environment.box2("foo", :virtualbox) } + let(:directory) { environment.box3("foo", "1.0", :virtualbox) } subject { described_class.new(name, provider, version, directory) } it "provides the name" do