core: Allow direct box adding again

This commit is contained in:
Mitchell Hashimoto 2014-04-02 19:45:49 -07:00
parent 3302bd535f
commit d1caf8c624
3 changed files with 7 additions and 4 deletions

View File

@ -66,10 +66,13 @@ module Vagrant
box_formats = machine.provider_options[:box_format] ||
machine.provider_name
version_ui = machine.config.vm.box_version
version_ui ||= ">= 0"
env[:ui].output(I18n.t(
"vagrant.box_auto_adding", name: machine.config.vm.box))
env[:ui].detail("Box Provider: #{Array(box_formats).join(", ")}")
env[:ui].detail("Box Version: #{machine.config.vm.box_version}")
env[:ui].detail("Box Version: #{version_ui}")
begin
env[:action_runner].run(Vagrant::Action.action_box_add, env.merge({

View File

@ -313,7 +313,7 @@ module VagrantPlugins
@box_download_client_cert = nil if @box_download_client_cert == UNSET_VALUE
@box_download_insecure = false if @box_download_insecure == UNSET_VALUE
@box_url = nil if @box_url == UNSET_VALUE
@box_version = ">= 0" if @box_version == UNSET_VALUE
@box_version = nil if @box_version == UNSET_VALUE
@graceful_halt_timeout = 60 if @graceful_halt_timeout == UNSET_VALUE
@guest = nil if @guest == UNSET_VALUE
@hostname = nil if @hostname == UNSET_VALUE

View File

@ -77,10 +77,10 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
context "#box_version" do
it "defaults to >= 0" do
it "defaults to nil" do
subject.finalize!
expect(subject.box_version).to eq(">= 0")
expect(subject.box_version).to be_nil
end
it "errors if invalid version" do