From 690d380b77760b4c1b387096cd6452ae9eb03589 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 11 Jul 2012 18:41:13 -0700 Subject: [PATCH] Use the new BoxCollection API --- lib/vagrant/action/vm/check_box.rb | 2 +- plugins/kernel_v1/config/vm.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/action/vm/check_box.rb b/lib/vagrant/action/vm/check_box.rb index aac2452d1..454f8b492 100644 --- a/lib/vagrant/action/vm/check_box.rb +++ b/lib/vagrant/action/vm/check_box.rb @@ -10,7 +10,7 @@ module Vagrant box_name = env[:vm].config.vm.box raise Errors::BoxNotSpecified if !box_name - if !env[:box_collection].find(box_name) + if !env[:box_collection].find(box_name, :virtualbox) box_url = env[:vm].config.vm.box_url raise Errors::BoxSpecifiedDoesntExist, :name => box_name if !box_url diff --git a/plugins/kernel_v1/config/vm.rb b/plugins/kernel_v1/config/vm.rb index 90de0014c..a4fb47487 100644 --- a/plugins/kernel_v1/config/vm.rb +++ b/plugins/kernel_v1/config/vm.rb @@ -122,9 +122,9 @@ module VagrantPlugins def validate(env, errors) errors.add(I18n.t("vagrant.config.vm.box_missing")) if !box - errors.add(I18n.t("vagrant.config.vm.box_not_found", :name => box)) if box && !box_url && !env.boxes.find(box) + errors.add(I18n.t("vagrant.config.vm.box_not_found", :name => box)) if box && !box_url && !env.boxes.find(box, :virtualbox) errors.add(I18n.t("vagrant.config.vm.boot_mode_invalid")) if ![:headless, :gui].include?(boot_mode.to_sym) - errors.add(I18n.t("vagrant.config.vm.base_mac_invalid")) if env.boxes.find(box) && !base_mac + errors.add(I18n.t("vagrant.config.vm.base_mac_invalid")) if env.boxes.find(box, :virtualbox) && !base_mac shared_folders.each do |name, options| hostpath = Pathname.new(options[:hostpath]).expand_path(env.root_path)