diff --git a/lib/vagrant/action/builtin/box_check_outdated.rb b/lib/vagrant/action/builtin/box_check_outdated.rb index 9026d9737..944fb6246 100644 --- a/lib/vagrant/action/builtin/box_check_outdated.rb +++ b/lib/vagrant/action/builtin/box_check_outdated.rb @@ -28,7 +28,12 @@ module Vagrant # message anyways. raise Errors::BoxOutdatedNoBox, name: machine.config.vm.box end + box = machine.box + if box.version == "0" && !box.metadata_url + return @app.call(env) + end + constraints = machine.config.vm.box_version env[:ui].output(I18n.t( diff --git a/test/unit/vagrant/action/builtin/box_check_outdated_test.rb b/test/unit/vagrant/action/builtin/box_check_outdated_test.rb index 1d6ecf921..32dcdac0e 100644 --- a/test/unit/vagrant/action/builtin/box_check_outdated_test.rb +++ b/test/unit/vagrant/action/builtin/box_check_outdated_test.rb @@ -72,6 +72,18 @@ describe Vagrant::Action::Builtin::BoxCheckOutdated do end end + context "with a non-versioned box" do + it "does nothing" do + box.stub(metadata_url: nil) + box.stub(version: "0") + + app.should_receive(:call).once + box.should_receive(:has_update?).never + + subject.call(env) + end + end + context "with a box" do it "sets env if no update" do box.should_receive(:has_update?).and_return(nil)