From 619fe9a0564d8bd1d14c943489a9b1e3e9518b34 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 31 Dec 2013 08:38:58 -0800 Subject: [PATCH] core: warn if no provider is specified that we can't check for it --- lib/vagrant/action/builtin/box_add.rb | 5 ++++- templates/locales/en.yml | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index ff0313b79..20ae3a9d4 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -33,7 +33,10 @@ module Vagrant # Determine if we already have the box before downloading # it again. We can only do this if we specify a format - if box_formats + if !box_formats + env[:ui].warn(I18n.t( + "vagrant.actions.box.download.no_provider_cant_check")) + else begin if env[:box_collection].find(box_name, box_formats) raise Errors::BoxAlreadyExists, diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 54f722fda..647a0ae7e 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -1213,6 +1213,11 @@ en: download_failed: |- Download failed. Will try another box URL if there is one. interrupted: "Box download was interrupted. Exiting." + no_provider_cant_check: |- + A provider wasn't explicitly provided to the "box add" command. + Without a provider, Vagrant can't verify if this box already + exists until the box is fully downloaded. This is just a warning, + and is not an error. resuming: "Box download is resuming from prior download progress" verify: verifying: "Verifying box..."