Use the new BoxCollection API

This commit is contained in:
Mitchell Hashimoto 2012-07-11 18:41:13 -07:00
parent f20666e230
commit 690d380b77
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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)